Merge pull request #48 from YoloDev/release-plz-2024-11-03T15-42-31Z #195
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
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: full | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Always run main branch builds to completion. | |
fail-fast: ${{ github.event_name == 'pull_request' || | |
(github.ref != 'refs/heads/main' && | |
!startsWith(github.ref, 'refs/tags/')) }} | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Configure git | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.symlinks true | |
git config --global fetch.parallel 32 | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Run sccache-cache | |
if: github.repository == 'YoloDev/rkyv-utils' | |
uses: mozilla-actions/sccache-action@v0.0.6 | |
- name: Configure sccache | |
if: github.repository == 'YoloDev/rkyv-utils' | |
shell: bash | |
run: | | |
if [[ -z "${{ secrets.SCCACHE_ENDPOINT }}" ]]; then | |
echo "SCCACHE_ENDPOINT is not set" | |
else | |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV | |
echo "SCCACHE_BUCKET=$SCCACHE_BUCKET" >> $GITHUB_ENV | |
echo "SCCACHE_REGION=$SCCACHE_REGION" >> $GITHUB_ENV | |
echo "SCCACHE_ENDPOINT=$SCCACHE_ENDPOINT" >> $GITHUB_ENV | |
echo "AWS_ACCESS_KEY_ID=$SCCACHE_ACCESS_KEY_ID" >> $GITHUB_ENV | |
echo "AWS_SECRET_ACCESS_KEY=$SCCACHE_SECRET_ACCESS_KEY" >> $GITHUB_ENV | |
fi | |
env: | |
SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET }} | |
SCCACHE_REGION: ${{ vars.SCCACHE_REGION }} | |
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }} | |
SCCACHE_ACCESS_KEY_ID: ${{ secrets.SCCACHE_ACCESS_KEY_ID }} | |
SCCACHE_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_SECRET_ACCESS_KEY }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v0 | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
# cache-provider: buildjet | |
- name: Install cargo-featurex | |
run: cargo install cargo-featurex | |
- name: Run check (all feature permutations) | |
run: cargo featurex clippy | |
- name: Run tests (all feature permutations) | |
run: cargo featurex test | |
miri-test: | |
name: Miri Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Always run main branch builds to completion. | |
fail-fast: ${{ github.event_name == 'pull_request' || | |
(github.ref != 'refs/heads/main' && | |
!startsWith(github.ref, 'refs/tags/')) }} | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Configure git | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.symlinks true | |
git config --global fetch.parallel 32 | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: miri | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v0 | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
# cache-provider: buildjet | |
- uses: extractions/setup-just@v2 | |
name: Setup just | |
- name: Run tests | |
run: just miri-test |