v0.5.0 Release #24
Workflow file for this run
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
# Credit to GitHub Copilot for generating this file | |
name: Rust CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- name: Build | |
run: cargo build --all-features --verbose | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --all-features | |
- name: Test Without Default Features | |
run: cargo test --all-features --verbose --no-default-features | |
- name: Test With all Features | |
run: cargo test --all-features --verbose | |
- name: Test With Image Feature | |
run: cargo test --features image --verbose | |
- name: Test with JPEG Feature | |
run: cargo test --features jpeg --verbose | |
- name: Test with PNG Feature | |
run: cargo test --features png --verbose | |
- name: Test with GIF Feature | |
run: cargo test --features gif --verbose | |
- name: Test with WEBP Feature | |
run: cargo test --features webp --verbose | |
- name: Test with Prompt Caching Feature | |
run: cargo test --features prompt-caching --verbose | |
- name: Test with Log Feature | |
run: cargo test --features log --verbose | |
- name: Test with Markdown Feature | |
run: cargo test --features markdown --verbose | |
- name: Test with PartialEq Feature | |
run: cargo test --features partial-eq --verbose | |
- name: Test with Langsan feature | |
run: cargo test --features langsan --verbose | |
- name: Test with Memsecurity feature | |
run: cargo test --features memsecurity --verbose | |
# This should only happen on push to main. PRs should not upload coverage. | |
- name: Install llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
- name: Write API key to api.key | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
run: echo ${{ secrets.ANTHROPIC_API_KEY }} > api.key | |
- name: Collect coverage data (including ignored tests) | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
run: cargo llvm-cov nextest --all-features --run-ignored all --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true |