refactor logic #202
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: Lucee data provider CI | |
on: [push, pull_request,workflow_dispatch] | |
jobs: | |
javabuild: | |
name: Java build | |
runs-on: ubuntu-latest | |
env: | |
luceeVersion: 6.0.3.1 | |
#luceeVersionQuery: 6.0.3/all/jar | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Cache Maven packages | |
if: always() | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: lucee-script-runner-maven-cache | |
- name: Cache Test Artifacts | |
if: always() | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/tests/artifacts | |
key: test-artifacts | |
- name: Cache Lucee files | |
uses: actions/cache@v4 | |
if: always() | |
with: | |
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache | |
key: lucee-downloads | |
- name: Compile CFML | |
uses: lucee/script-runner@main | |
with: | |
webroot: ${{ github.workspace }} | |
luceeVersion: ${{ env.luceeVersion }} | |
#luceeVersionQuery: ${{ env.luceeVersionQuery }} | |
execute: /compile.cfm | |
compile: true | |
- name: Checkout Lucee | |
uses: actions/checkout@v4 | |
with: | |
repository: lucee/lucee | |
path: lucee | |
- name: Run Lucee Test Suite (testLabels="data-provider") | |
uses: lucee/script-runner@main | |
with: | |
webroot: ${{ github.workspace }}/lucee/test | |
execute: /bootstrap-tests.cfm | |
luceeVersion: ${{ env.luceeVersion }} | |
#luceeVersionQuery: ${{ env.luceeVersionQuery }} | |
extensionDir: ${{ github.workspace }}/ | |
env: | |
testLabels: data-provider | |
testAdditional: ${{ github.workspace }}/tests | |
testSevices: mysql | |
LUCEE_ADMIN_ENABLED: false | |
- name: Run Lucee Test Suite (testLabels="data-provider-integration") (expected to fail) | |
uses: lucee/script-runner@main | |
continue-on-error: true | |
with: | |
webroot: ${{ github.workspace }}/lucee/test | |
execute: /bootstrap-tests.cfm | |
luceeVersion: ${{ env.luceeVersion }} | |
#luceeVersionQuery: ${{ env.luceeVersionQuery }} | |
extensionDir: ${{ github.workspace }}/ | |
env: | |
testLabels: data-provider-integration | |
testAdditional: ${{ github.workspace }}/tests | |
testSevices: mysql | |
LUCEE_ADMIN_ENABLED: false | |
build: | |
name: Docker build & publish | |
runs-on: ubuntu-latest | |
needs: [javabuild] | |
if: "github.ref == 'refs/heads/main' && github.event_name == 'push'" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Create Docker Buildx builder | |
run: | | |
docker buildx create --name lucee_builder | |
docker buildx inspect lucee_builder --bootstrap | |
- name: Push to docker | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm64 --build-arg SENTRY_ENV=UAT --build-arg SENTRY_DSN=:${{ env.SENTRY_DSN }} -t markdrew/lucee-downloads:latest -t markdrew/lucee-downloads:${{ github.sha }} -f devops/Dockerfile.download . --push | |
docker buildx build --platform linux/amd64,linux/arm64 --build-arg SENTRY_ENV=UAT --build-arg SENTRY_DSN=:${{ env.SENTRY_DSN }} -t markdrew/lucee-update:latest -t markdrew/lucee-update:${{ github.sha }} -f devops/Dockerfile.update . --push | |
deploy-to-update: | |
name: Deploy to update.lucee.org | |
runs-on: ubuntu-latest | |
needs: [build] | |
environment: | |
name: productiondeploy | |
steps: | |
- name: Deploy to update.lucee.org | |
run: curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/update/" | |
deploy-to-downloads: | |
name: Deploy to download.lucee.org | |
runs-on: ubuntu-latest | |
needs: [build] | |
environment: | |
name: productiondeploy | |
steps: | |
- name: Deploy to downloads.lucee.org | |
run: curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/download/" |