Skip to content

Commit

Permalink
Clean up the GitHub Actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickpeterse committed May 24, 2024
1 parent 1203025 commit 5b459b9
Showing 1 changed file with 30 additions and 35 deletions.
65 changes: 30 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
workflow_dispatch:

env:
CARGO_HOME: ${{ github.workspace }}/.cargo
CARGO_HOME: ${{ github.workspace }}/.cargo-home
RUSTUP_HOME: ${{ github.workspace }}/.rustup-home
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
cargo-deny:
Expand All @@ -19,70 +21,63 @@ jobs:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1

# Clippy uses a specific version as its lints change over time, which could
# result in random unrelated CI failures. We'll bump this version every now
# and then when needed.
cargo-clippy:
gitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: 'clippy'
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cargo
target
key: ${{ runner.os }}-alpine
- run: 'cargo clippy -- -D warnings'
fetch-depth: 10
- run: pip install gitlint
- run: git config --global --add safe.directory $PWD
- run: gitlint --commits "HEAD~9..HEAD"

cargo-fmt:
cargo-clippy:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/ci:fedora
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: 'rustfmt'
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}-alpine
- run: 'cargo fmt --all --check'
key: fedora
- name: Run clippy
run: 'cargo clippy -- -D warnings'

gitlint:
cargo-fmt:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/ci:fedora
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
fetch-depth: 10
- run: pip install gitlint
- run: git config --global --add safe.directory $PWD
- run: gitlint --commits "HEAD~9..HEAD"
path: |
${{ env.CARGO_HOME }}
target
key: fedora
- name: Run rustfmt
run: 'cargo fmt --all --check'

test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
version:
- '1.68'
- stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.version }}
toolchain: 1.70
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}-stable
key: ${{ runner.os }}
- name: Running tests
run: cargo test

0 comments on commit 5b459b9

Please sign in to comment.