This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 57
98 lines (92 loc) · 2.57 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
jobs:
check_changes:
name: Check changes
runs-on: ubuntu-latest
outputs:
npm_assets_changed: ${{ steps.get_changes.outputs.npm_assets }}
rust_src_changed: ${{ steps.get_changes.outputs.rust_src }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: get_changes
with:
filters: |
npm_assets:
- 'bcml/assets/**'
rust_src:
- 'src/**'
- 'bootstrap.sh'
- 'Cargo.toml'
- 'pyproject.toml'
npm_build:
name: npm build
needs: check_changes
if: ${{ needs.check_changes.outputs.npm_assets_changed == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
working-directory: bcml/assets
- run: npm run build
working-directory: bcml/assets
maturin_build_linux:
name: Maturin (Linux)
needs: check_changes
if: ${{ needs.check_changes.outputs.rust_src_changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: default
components: rustfmt, rust-src
- name: install-cmake
uses: Symbitic/[email protected]
- name: Patch roead version
run: sed -i 's/<0.10.4/0.10.4/g' Cargo.toml
- name: Check
run: cargo +nightly check --verbose
- uses: messense/maturin-action@v1
with:
maturin-version: latest
command: build
args: --release
rust-toolchain: nightly
maturin_build_win:
name: Maturin (Windows)
needs: check_changes
if: ${{ needs.check_changes.outputs.rust_src_changed == 'true' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: default
components: rustfmt, rust-src
- uses: messense/maturin-action@v1
name: Build with Maturin
with:
maturin-version: latest
command: build
args: --release
rust-toolchain: nightly