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