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 83396c2
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 29 deletions.
85 changes: 56 additions & 29 deletions .github/workflows/ci.yml
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
Expand All @@ -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/
Expand All @@ -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
Expand All @@ -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:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/win.yml
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 }}"

0 comments on commit 83396c2

Please sign in to comment.