universal-android-debloater.../.github/workflows/ci.yml
w1nst0n 7788f3cf83
[CI] Github Actions overhaul (+ add auto dev-build release) (#364)
- Big refactoring using the new reusable workflow feature
- Better use of caching
- Replace lld linker on MacOS/Linux by a better one: https://github.com/rui314/mold
- Automatically create a `dev-build` release whenever a commit changing the software code lands into the main branch
- Replace unmaintained Github Action `actions-rs/toolchain` by `dtolnay/rust-toolchain`
- Update all others Github Actions (I now watch all the repositories to be notified on new release)
- Use the new `automatically generated release notes` feature from Github
2022-08-28 21:19:03 +00:00

61 lines
1.6 KiB
YAML

name: Continuous Integration
on:
push:
paths:
- '**.rs'
- 'Cargo.lock'
- 'Cargo.toml'
- '**.json'
tags-ignore:
- '*'
pull_request:
paths:
- '**.rs'
- 'Cargo.lock'
- 'Cargo.toml'
- '**.json'
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
lint: [check, test, clippy, fmt]
exclude: # https://github.com/community/community/discussions/7835
- os: windows-latest
lint: clippy
- os: windows-latest
lint: fmt
- os: macOS-latest
lint: clippy
- os: macOS-latest
lint: fmt
include:
- lint: check
args: " --all-features"
- lint: test
args: ''
- lint: clippy
args: " --all --all-features -- -D warnings"
- lint: fmt
args: " --all -- --check"
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1 # faster linker
with:
make-default: false
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-${{ matrix.lint }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.OS }}-${{ matrix.lint }}-
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy,rustfmt
- run: cargo ${{ matrix.lint }}${{ matrix.args }}