-
Notifications
You must be signed in to change notification settings - Fork 94
72 lines (72 loc) · 3.23 KB
/
Copy pathci.yml
File metadata and controls
72 lines (72 loc) · 3.23 KB
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
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: Auto Build CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable]
defaults:
run:
shell: bash
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust toolchain ${{ matrix.rust }}
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy --target wasm32-unknown-unknown
rustup default ${{ matrix.rust }}
rustc --version
cargo --version
# Work around https://github.com/actions/cache/issues/403 by using GNU tar
# instead of BSD tar.
- name: Install GNU tar
if: matrix.os == 'macos-latest'
run: |
# Install GNU tar if not present, on macOS Homebrew may be in different locations
if ! command -v gtar >/dev/null 2>&1; then
brew install gnu-tar || true
fi
# Add GNU tar to PATH via GITHUB_ENV for actions that rely on gnu-tar
if [ -d "/usr/local/opt/gnu-tar/libexec/gnubin" ]; then
echo "PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
elif [ -d "/opt/homebrew/opt/gnu-tar/libexec/gnubin" ]; then
echo "PATH=/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
fi
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Release build async-std
run: cargo build --release --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain
- name: Release build tokio
run: cargo build --release --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Test For All Features Using async-std
run: cargo test --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Test For All Features Using tokio
run: cargo test --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Check Wasm
env:
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
run: cargo check --target wasm32-unknown-unknown --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental
- name: Clippy warnings
run: cargo clippy -- -D warnings
- name: Cargo Fmt Check
run: cargo fmt --all -- --check