Run Cargo clippy and fmt in CI (#392) #551
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
integration-linux: | |
name: "Integration Tests (Java ${{ matrix.java-version }})" | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: | |
- 21 | |
env: | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: ${{ matrix.java-version }} | |
- name: Setup Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Example" | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Heroku CLI | |
run: curl https://cli-assets.heroku.com/install.sh | sh | |
- name: Package heroku-jvm-application-deployer | |
run: "./mvnw --batch-mode package" | |
- name: Package integration test fixtures | |
working-directory: "integration-test/fixtures/war-app" | |
run: "./mvnw --batch-mode package" | |
- name: Package integration test fixtures | |
working-directory: "integration-test/fixtures/jar-app" | |
run: "./mvnw --batch-mode package" | |
- name: Run integration tests | |
working-directory: "integration-test" | |
run: "cargo test --locked" | |
rust-lint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 | |
with: | |
workspaces: "./integration-test" | |
- name: Clippy | |
run: cargo clippy --all-targets --all-features --locked -- --deny warnings | |
working-directory: integration-test | |
- name: rustfmt | |
run: cargo fmt -- --check | |
working-directory: integration-test | |
maven: | |
name: "Unit Tests (Java ${{ matrix.java-version }})" | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: | |
- 8 | |
- 21 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: ${{ matrix.java-version }} | |
- run: "./mvnw --batch-mode test" |