| 1 |
name: CI |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
env: |
| 5 |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
| 6 |
|
| 7 |
jobs: |
| 8 |
test: |
| 9 |
name: Test |
| 10 |
runs-on: ${{ matrix.os }} |
| 11 |
strategy: |
| 12 |
matrix: |
| 13 |
rust: [stable, beta, nightly] |
| 14 |
os: [ubuntu-latest, macos-14, windows-latest] |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@master |
| 17 |
- name: Install Rust (rustup) |
| 18 |
run: | |
| 19 |
rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal |
| 20 |
rustup default ${{ matrix.rust }} |
| 21 |
shell: bash |
| 22 |
|
| 23 |
- uses: Swatinem/rust-cache@v2 |
| 24 |
|
| 25 |
- run: cargo test --locked |
| 26 |
|
| 27 |
- name: Compile make 4.4.1 |
| 28 |
uses: ./.github/actions/compile-make |
| 29 |
with: |
| 30 |
version: 4.4.1 |
| 31 |
|
| 32 |
- name: Test against GNU Make 4.4.1 |
| 33 |
if: ${{ !startsWith(matrix.os, 'windows') }} |
| 34 |
shell: bash |
| 35 |
run: cargo test --locked |
| 36 |
env: |
| 37 |
MAKE: /usr/local/bin/make-4.4.1 |
| 38 |
|
| 39 |
- name: Ensure wasm32-unknown-unknown be buildable |
| 40 |
if: matrix.os == 'ubuntu-latest' |
| 41 |
shell: bash |
| 42 |
run: | |
| 43 |
rustup target add wasm32-unknown-unknown |
| 44 |
cargo build --locked --target wasm32-unknown-unknown |
| 45 |
|
| 46 |
test_musl: |
| 47 |
name: Test (stable, alpine-latest) |
| 48 |
container: rust:alpine |
| 49 |
runs-on: ubuntu-latest |
| 50 |
steps: |
| 51 |
- uses: actions/checkout@master |
| 52 |
|
| 53 |
- name: Install make dependencies |
| 54 |
run: apk add musl-dev bash curl make tar |
| 55 |
|
| 56 |
- uses: Swatinem/rust-cache@v2 |
| 57 |
|
| 58 |
- name: Compile make 4.4.1 |
| 59 |
uses: ./.github/actions/compile-make |
| 60 |
with: |
| 61 |
version: 4.4.1 |
| 62 |
|
| 63 |
- name: Test against GNU Make 4.4.1 |
| 64 |
shell: bash |
| 65 |
run: cargo test --locked |
| 66 |
env: |
| 67 |
MAKE: /usr/local/bin/make-4.4.1 |
| 68 |
|
| 69 |
rustfmt: |
| 70 |
name: Rustfmt |
| 71 |
runs-on: ubuntu-latest |
| 72 |
steps: |
| 73 |
- uses: actions/checkout@master |
| 74 |
- name: Install Rust |
| 75 |
run: rustup update stable && rustup default stable && rustup component add rustfmt |
| 76 |
- run: cargo fmt -- --check |
| 77 |
|
| 78 |
publish_docs: |
| 79 |
name: Publish Documentation |
| 80 |
runs-on: ubuntu-latest |
| 81 |
steps: |
| 82 |
- uses: actions/checkout@master |
| 83 |
- name: Install Rust |
| 84 |
run: rustup update stable && rustup default stable |
| 85 |
- name: Build documentation |
| 86 |
run: cargo doc --no-deps --all-features |
| 87 |
- name: Publish documentation |
| 88 |
run: | |
| 89 |
cd target/doc |
| 90 |
git init |
| 91 |
git add . |
| 92 |
git -c user.name='ci' -c user.email='ci' commit -m init |
| 93 |
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages |
| 94 |
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' |
| 95 |
|
| 96 |
msrv: |
| 97 |
runs-on: ${{ matrix.os }} |
| 98 |
strategy: |
| 99 |
matrix: |
| 100 |
os: [ubuntu-latest, macos-14, windows-latest] |
| 101 |
steps: |
| 102 |
- uses: actions/checkout@master |
| 103 |
- name: Install Rust (rustup) |
| 104 |
run: rustup toolchain install nightly --no-self-update --profile minimal |
| 105 |
shell: bash |
| 106 |
|
| 107 |
- uses: taiki-e/install-action@cargo-hack |
| 108 |
- uses: Swatinem/rust-cache@v2 |
| 109 |
|
| 110 |
- run: cargo hack check --lib --rust-version --ignore-private --locked |