name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
JSTD_REPOSITORY: ${{ vars.JSTD_REPOSITORY || format('{0}/jstd', github.repository_owner) }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out wazabin-jstd
run: |
git clone --depth=1 "https://github.com/${JSTD_REPOSITORY}.git" \
"$GITHUB_WORKSPACE/../wazabin-jstd"
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo test --all-features
- run: cargo doc --no-deps
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out wazabin-jstd
run: |
git clone --depth=1 "https://github.com/${JSTD_REPOSITORY}.git" \
"$GITHUB_WORKSPACE/../wazabin-jstd"
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov --all-features --fail-under-lines 75 --lcov --output-path lcov.info
- run: cargo llvm-cov report --summary-only
- uses: actions/upload-artifact@v4
with:
name: lcov
path: lcov.info
if-no-files-found: error