-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
131 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
master | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -12,23 +16,21 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
test: | ||
name: Test | ||
runs-on: [ubuntu-latest, macos-latest, windows-latest] | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update nightly | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Dependency | ||
run: cargo fetch | ||
- uses: actions/cache@v3 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
|
@@ -38,20 +40,19 @@ jobs: | |
target/ | ||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Generate code coverage | ||
run: cargo +nightly llvm-cov nextest | ||
--all-features --workspace | ||
--ignore-filename-regex jpegxl-sys/ | ||
--lcov --output-path lcov.info | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: lcov.info | ||
fail_ci_if_error: true | ||
|
||
run: cargo +nightly nextest run --all-features --workspace | ||
|
||
sanitizer: | ||
strategy: | ||
matrix: | ||
sanitizer: [address, leak, memory, thread] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: macos-13 | ||
target: x86_64-apple-darwin | ||
name: Sanitizers | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -65,42 +66,68 @@ jobs: | |
uses: taiki-e/install-action@nextest | ||
- name: Dependency | ||
run: cargo fetch | ||
- uses: actions/cache@v3 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-sanitizer-${{ hashFiles('**/Cargo.lock') }} | ||
key: ${{ runner.os }}-cargo-sanitizer-${{ matrix.sanitizer }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Address Sanitizer | ||
run: cargo +nightly nextest run -Z build-std --target=x86_64-unknown-linux-gnu --all-features | ||
run: cargo +nightly nextest run -Z build-std --target=${{ matrix.target }} --all-features | ||
env: | ||
RUSTFLAGS: "-Z sanitizer=address" | ||
RUSTDOCFLAGS: "-Z sanitizer=address" | ||
RUSTFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" | ||
RUSTDOCFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" | ||
|
||
clippy: | ||
name: Clippy | ||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update stable | ||
run: rustup update nightly | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Dependency | ||
run: cargo fetch | ||
- uses: actions/cache@v3 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} | ||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Generate code coverage | ||
run: cargo +nightly llvm-cov nextest | ||
--all-features --workspace | ||
--ignore-filename-regex jpegxl-sys/ | ||
--lcov --output-path lcov.info | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: lcov.info | ||
fail_ci_if_error: true | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update stable | ||
- name: Run Clippy with reviewdog | ||
uses: giraffate/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Win | ||
|
||
on: push | ||
|
||
jobs: | ||
coverage: | ||
name: Test | ||
runs-on: windows-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update nightly | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Dependency | ||
run: cargo fetch | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
- name: Test | ||
run: | | ||
cargo +nightly nextest run -v --all-features --workspace | ||
sanitizer: | ||
strategy: | ||
matrix: | ||
sanitizer: [address, leak, thread] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
sanitizer: memory | ||
- os: macos-13 | ||
target: x86_64-apple-darwin | ||
- os: macos-13 | ||
target: aarch64-apple-darwin | ||
name: Sanitizers | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update nightly | ||
- name: Add rust-src | ||
run: rustup +nightly component add rust-src | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Dependency | ||
run: cargo fetch | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-sanitizer-${{ matrix.sanitizer }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Address Sanitizer | ||
run: cargo +nightly nextest run -Z build-std --target=${{ matrix.target }} --all-features | ||
env: | ||
RUSTFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" | ||
RUSTDOCFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" |