-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (80 loc) · 1.96 KB
/
build-and-test.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
name: cargo build & test
on:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
schedule:
- cron: '0 18 * * 5'
push:
branches: [ 'main' ]
paths-ignore:
- "**/docs/**"
- "**.md"
pull_request:
paths-ignore:
- "**/docs/**"
- "**.md"
types:
- opened
- reopened
- synchronize
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- qsk-types
- qsk-macros
- ./
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- name: test
env:
DIRECTORY: ${{ matrix.directory }}
run: |
cd $DIRECTORY
cargo test
- name: build
env:
DIRECTORY: ${{ matrix.directory }}
run: |
cd $DIRECTORY
cargo build --release --all-features
qsk-template-reify-and-build:
runs-on: ubuntu-latest
env:
PROJECT_NAME: mytemplate
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- uses: cargo-generate/[email protected]
with:
name: ${{ env.PROJECT_NAME }}
template: qsk-template
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
# we need to move the generated project to a temp folder, away from the template project
# otherwise `cargo` runs would fail
# see https://github.com/rust-lang/cargo/issues/9922
- run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
cargo build