Skip to content

Commit

Permalink
Test win ci
Browse files Browse the repository at this point in the history
  • Loading branch information
inflation committed Jan 22, 2024
1 parent 0fd2388 commit cd29768
Showing 1 changed file with 77 additions and 40 deletions.
117 changes: 77 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- master
- ci
pull_request:

env:
CARGO_TERM_COLOR: always
Expand All @@ -12,23 +17,25 @@ concurrency:
cancel-in-progress: true

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
test:
name: Test
if: ${{ false }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
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/
Expand All @@ -38,19 +45,54 @@ 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:
name: Sanitizers
strategy:
matrix:
target:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- os: macos-13
triple: x86_64-apple-darwin
sanitizer: [address, leak, thread]
include:
- target:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
sanitizer: memory
runs-on: ${{ matrix.target.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.triple }} --all-features
env:
RUSTFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}"
RUSTDOCFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}"

coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -59,26 +101,32 @@ jobs:
submodules: recursive
- name: Install Rust
run: rustup update nightly
- name: Add rust-src
run: rustup +nightly component add rust-src
- 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-sanitizer-${{ hashFiles('**/Cargo.lock') }}
- name: Address Sanitizer
run: cargo +nightly nextest run -Z build-std --target=x86_64-unknown-linux-gnu --all-features
env:
RUSTFLAGS: "-Z sanitizer=address"
RUSTDOCFLAGS: "-Z sanitizer=address"
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
Expand All @@ -90,22 +138,11 @@ jobs:
submodules: recursive
- name: Install Rust
run: rustup update stable
- name: Dependency
run: cargo fetch
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
- name: Run Clippy with reviewdog
uses: giraffate/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-features --tests -- -D warnings
clippy_flags: --tests -- -D warnings
reporter: github-check

fmt:
Expand Down

0 comments on commit cd29768

Please sign in to comment.