Skip to content

Commit

Permalink
add maven build
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jun 25, 2024
1 parent bbc7970 commit 7d42e47
Show file tree
Hide file tree
Showing 13 changed files with 510 additions and 361 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/main-5.4.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/main-6.0.yml

This file was deleted.

179 changes: 128 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,56 @@
# This workflow will build a Java project with Ant
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant

name: Java CI - Lucee 6.1
name: Java CI Combined

on: [push, pull_request, workflow_dispatch]

jobs:
build:
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:
LUCEE_TEST_VERSIONS: ${{ vars.LUCEE_TEST_VERSIONS }}
strategy:
matrix:
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS) }}
services:
redis:
# Docker Hub image
Expand All @@ -22,51 +64,86 @@ jobs:
ports:
# Maps port 6379 on service container to the host
- 6379:6379
env:
luceeVersion: light-6.0.0.451-BETA
luceeVersionQuery: 6.1/snapshot/light
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: redis-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: redis
testAdditional: ${{ github.workspace }}/tests

deploy:
runs-on: ubuntu-latest
needs: [build-and-test]
if: always() && needs.build-and-test.result == 'success'
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Cache Lucee files
uses: actions/cache@v4
with:
path: _actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads-${{ env.luceeVersion }}
restore-keys: |
lucee-downloads
- name: Build with Ant
run: ant -noinput -verbose -buildfile build.xml
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: redis-lex
path: dist/*.lex
- name: Checkout Lucee
uses: actions/checkout@v4
with:
repository: lucee/lucee
path: lucee
- name: Run Lucee Test Suite, labels="redis"
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/lucee/test
execute: /bootstrap-tests.cfm
luceeVersion: ${{ env.luceeVersion }}
luceeVersionQuery: ${{ env.luceeVersionQuery }}
extensionDir: ${{ github.workspace }}/dist
env:
testLabels: redis
testAdditional: ${{ github.workspace }}/tests
REDIS_PORT: 6379
REDIS_SERVER: localhost
- 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.class
*.classpath
*.DS_Store
dist/
target/
43 changes: 0 additions & 43 deletions ExtensionProvider.cfc

This file was deleted.

Loading

0 comments on commit 7d42e47

Please sign in to comment.