AG-230 - Fix deprecation in github action #162
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: Agroal CI | ||
on: | ||
push: | ||
branches: '**' | ||
pull_request: | ||
schedule: | ||
- cron: '0 5 * * 0' # at 05:00 on Sunday | ||
jobs: | ||
build: | ||
name: Java 17 - Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
cache: 'maven' | ||
distribution: 'temurin' | ||
java-package: jdk | ||
java-version: '17' | ||
- run: mvn -B install | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: agroal-repository-artifact | ||
path: ~/.m2/repository/io/agroal/** | ||
retention-days: 1 | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
strategy: | ||
matrix: | ||
java: [ 21, 17, 11 ] | ||
name: Java ${{ matrix.java }} - Test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
cache: 'maven' | ||
distribution: 'temurin' | ||
java-package: jdk | ||
java-version: ${{ matrix.java }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: agroal-repository-artifact | ||
path: ~/.m2/repository/io/agroal | ||
# don't run spring tests on JVMs older than 17 | ||
- run: rm -fr agroal-test/src/test/java/io/agroal/test/springframework && mvn --projects agroal-test verify -Dversion.org.springframework.boot=2.6.1 | ||
deploy: | ||
if: ${{ github.repository == 'barreiro/agroal' && github.ref == 'refs/heads/master' }} | ||
runs-on: ubuntu-latest | ||
needs: [ build, test ] | ||
name: Java 17 - Rebuild and Deploy Snapshot Artifacts | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
cache: 'maven' | ||
distribution: 'temurin' | ||
java-package: jdk | ||
java-version: '17' | ||
server-id: jboss-snapshots-repository | ||
server-username: MAVEN_CI_USERNAME | ||
server-password: MAVEN_CI_PASSWORD | ||
- id: project | ||
run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV" | ||
- if: endsWith($env.PROJECT_VERSION, '-SNAPSHOT') | ||
Check failure on line 68 in .github/workflows/maven-action.yml GitHub Actions / Agroal CIInvalid workflow file
|
||
run: mvn -B deploy | ||
env: | ||
MAVEN_CI_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_CI_PASSWORD: ${{ secrets.MAVEN_TOKEN }} | ||