-
Notifications
You must be signed in to change notification settings - Fork 54
138 lines (114 loc) · 3.56 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: build
on:
push:
pull_request:
branches:
- master
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"
RUST_BACKTRACE: short
NEXTEST_PROFILE: ci
CI: 1
jobs:
build-crux:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- uses: dtolnay/[email protected]
with:
components: rustfmt
- uses: pnpm/action-setup@v2
with:
version: 7.32.2
- name: Check formatting
shell: bash
run: cargo fmt --all --check
- name: Build crux
shell: bash
run: cargo build --workspace
- name: Install nextest
shell: bash
run: |
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Build tests
shell: bash
run: |
cargo nextest run --workspace --all-features --no-run
- name: Run tests
shell: bash
run: |
cargo nextest run --workspace --all-features
- name: Build & run doctests
shell: bash
run: |
cargo test --doc --workspace
find-examples:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
outputs:
examples: ${{ steps.find.outputs.examples }}
steps:
- uses: actions/checkout@v2
- id: find
run: |
EXAMPLES=$(ls -d examples/*/ | xargs -L 1 basename | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT
build-examples:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
needs: find-examples
strategy:
matrix:
example: ${{ fromJson(needs.find-examples.outputs.examples) }}
defaults:
run:
working-directory: examples/${{ matrix.example }}
steps:
- uses: actions/checkout@v2
# The counter example uses tauri, which has additional dependencies that are not needed for other examples
- name: Install tauri dependencies
shell: bash
if: ${{ matrix.example == 'counter' }}
run: >
sudo apt-get update &&
sudo apt-get install -y
build-essential
curl
wget
libssl-dev
libgtk-3-dev
libayatana-appindicator3-dev
librsvg2-dev
libwebkit2gtk-4.1-dev
- uses: Swatinem/rust-cache@v1
- uses: dtolnay/[email protected]
with:
components: rustfmt
- uses: pnpm/action-setup@v2
with:
version: 7.32.2
- name: Check formatting
shell: bash
run: cargo fmt --all --check
- name: Build ${{ matrix.example }}
shell: bash
run: cargo build --workspace
- name: Install nextest
shell: bash
run: |
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Build tests
shell: bash
run: |
cargo nextest run --workspace --all-features --no-run
- name: Run tests
shell: bash
run: |
cargo nextest run --workspace --all-features
- name: Build & run doctests
shell: bash
run: |
cargo test --doc --workspace