make sure buckets get deleted after the job #485
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI Combined | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.extract-version.outputs.VERSION }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Extract version number | |
id: extract-version | |
run: | | |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "::set-output name=VERSION::$VERSION" | |
- name: Cache Lucee files | |
uses: actions/cache@v4 | |
with: | |
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache | |
key: lucee-downloads | |
- name: Import GPG key | |
run: | | |
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
build-and-test: | |
runs-on: ubuntu-latest | |
needs: setup | |
env: | |
S3_ACCESS_KEY_ID: ${{ secrets.S3_AMAZON_ACCESS_KEY_ID }} | |
S3_SECRET_KEY: ${{ secrets.S3_AMAZON_SECRET_KEY }} | |
S3_BUCKET_PREFIX: lucee-ldev-e- | |
S3_AMAZON_ACCESS_KEY_ID: ${{ secrets.S3_AMAZON_ACCESS_KEY_ID }} | |
S3_AMAZON_SECRET_KEY: ${{ secrets.S3_AMAZON_SECRET_KEY }} | |
S3_AMAZON_BUCKET_PREFIX: lucee-ldev-e- | |
S3_CUSTOM_ACCESS_KEY_ID: "minioadmin" | |
S3_CUSTOM_SECRET_KEY: "minioadmin" | |
S3_CUSTOM_HOST: "localhost:9000" | |
S3_CUSTOM_BUCKET_PREFIX: lucee-ldev-e- | |
S3_BACKBLAZE_ACCESS_KEY_ID: 005a56c2ce399e70000000001 | |
S3_BACKBLAZE_SECRET_KEY: ${{ secrets.S3_BACKBLAZE_SECRET_KEY }} | |
S3_BACKBLAZE_HOST: s3.us-east-005.backblazeb2.com | |
S3_BACKBLAZE_BUCKET_PREFIX: lucee-ldev-e- | |
S3_WASABI_ACCESS_KEY_ID: JM8VC29WSODA1DRT2H4Y | |
S3_WASABI_SECRET_KEY: ${{ secrets.S3_WASABI_SECRET_KEY }} | |
S3_WASABI_HOST: s3.eu-central-1.wasabisys.com | |
S3_WASABI_BUCKET_PREFIX: lucee-ldev-e- | |
S3_GOOGLE_ACCESS_KEY_ID: ${{ secrets.S3_GOOGLE_ACCESS_KEY_ID }} | |
S3_GOOGLE_SECRET_KEY: ${{ secrets.S3_GOOGLE_SECRET_KEY }} | |
S3_GOOGLE_HOST: storage.googleapis.com | |
S3_GOOGLE_BUCKET_PREFIX: lucee-ldev-e- | |
LUCEE_TEST_VERSIONS: ${{ vars.LUCEE_TEST_VERSIONS }} | |
strategy: | |
matrix: | |
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS) }} | |
services: | |
minio: | |
image: fclairamb/minio-github-actions | |
ports: | |
- 9000:9000 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Build and Install with Maven | |
run: | | |
echo "------- Maven Install -------"; | |
mvn -B -e -f pom.xml clean install | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: s3-lex-${{ matrix.lucee.version }} | |
path: target/*.lex | |
- name: Checkout Lucee | |
uses: actions/checkout@v4 | |
with: | |
repository: lucee/lucee | |
path: lucee | |
- name: Run Lucee Test Suite | |
uses: lucee/script-runner@main | |
with: | |
webroot: ${{ github.workspace }}/lucee/test | |
execute: /bootstrap-tests.cfm | |
luceeVersion: ${{ matrix.lucee.version }} | |
luceeVersionQuery: ${{ matrix.lucee.query }} | |
extensionDir: ${{ github.workspace }}/target | |
env: | |
testLabels: s3 | |
testAdditional: ${{ github.workspace }}/tests | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build-and-test] | |
if: always() && needs.build-and-test.result == 'success' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Import GPG key | |
run: | | |
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Build and Deploy with Maven | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
if [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then | |
echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------"; | |
mvn -B -e -f pom.xml clean deploy --settings maven-settings.xml | |
else | |
echo "------- Maven Deploy release on ${{ github.event_name }} -------"; | |
mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml | |
fi |