-
-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (121 loc) · 3.23 KB
/
main.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
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
name: Pull Request
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
lint:
name: Format & Clippy
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.80.1 # MSRV
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
components: rustfmt, clippy
- name: Run fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run clippy
if: always()
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
unit_tests:
name: Unit Tests on ${{ matrix.toolchain }}
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.80.1 # MSRV
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
- name: Run Unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --lib
- name: Run Doc tests
uses: actions-rs/cargo@v1
with:
command: test
args: --doc
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.80.1 # MSRV
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
target: wasm32-unknown-unknown
- uses: jetli/wasm-bindgen-action@v0.1.0
with:
version: 'latest'
- name: Install yarn
run: npm install yarn
- name: Build app
run: yarn run build
# - uses: isbang/compose-action@v1.0.0
# with:
# compose-file: ./docker-compose.yml
# - name: Run Integration tests
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --test interaction -- --ignored --test-threads=1
# site:
# name: Deploy site
# runs-on: ubuntu-latest
# if: ${{ github.event_name == 'push' }}
# steps:
# - uses: actions/checkout@v2
# - uses: Swatinem/rust-cache@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: 1.80.1
# override: true
# profile: minimal
# target: wasm32-unknown-unknown
# - uses: jetli/wasm-bindgen-action@v0.1.0
# with:
# version: 'latest'
# - name: Install yarn
# run: npm install yarn
# - name: Build app
# run: yarn run build
# - name: Deploy to Netlify
# uses: nwtgck/actions-netlify@v1.2
# with:
# publish-dir: './dist'
# github-token: ${{ secrets.GITHUB_TOKEN }}
# deploy-message: ${{ github.event.head_commit.message }}
# production-deploy: true
# production-branch: main
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# timeout-minutes: 5