-
Notifications
You must be signed in to change notification settings - Fork 16
81 lines (76 loc) · 2.25 KB
/
build.yaml
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
name: Build
on: [push, pull_request]
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust:
- stable
include:
- os: ubuntu-latest
rust: 1.63.0
- os: ubuntu-latest
rust: nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: Swatinem/rust-cache@v2
# `demo` crate doesn't work with the MSRV.
- name: Exclude `demo` crate from MSRV
run: sed -i -e 's/"demo",//' -e 's/"tools",//' Cargo.toml; cargo update --workspace
if: ${{ matrix.rust != 'stable' && matrix.rust != 'nightly' }}
- run: cargo build --locked
- run: cargo test --locked
- run: cargo bench --locked
- uses: actions/upload-artifact@v2
if: ${{ matrix.rust == 'stable' }}
with:
path: |
target
!target/**/*.d
!target/**/*.rlib
!target/**/.cargo-lock
!target/**/.fingerprint
!target/**/CACHEDIR.TAG
!target/**/build
!target/**/deps
!target/**/incremental
name: libtw2-${{ matrix.os }}
build-uniffi:
name: Build uniffi
runs-on: ubuntu-latest
steps:
- run: pip install build
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
with:
workspaces: uniffi
- run: cd uniffi; cargo build --locked
- run: cd uniffi; cargo test --locked
- run: cd uniffi; cargo bench --locked
- run: cd uniffi/huffman; python -m build; pip install dist/libtw2_huffman-*.whl
- run: cd uniffi/tests; python -m unittest *.py
check-generated:
name: Check that generated files match
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./generate_all
- run: test -z "$(git status --porcelain)"
check-rustfmt:
name: Check that everything is rustfmtted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo fmt --check