-
Notifications
You must be signed in to change notification settings - Fork 10
93 lines (89 loc) · 3.07 KB
/
check.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
name: Clippy, Format & Test
on: [pull_request, push, workflow_dispatch]
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check extension
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path=extension/wasm_src/Cargo.toml --all -- --check
- name: Check tests
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path=extension/integration_test/Cargo.toml --all -- --check
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Check extension
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=extension/wasm_src/Cargo.toml -- -D warnings
- name: Check tests
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=extension/integration_test/Cargo.toml -- -D warnings
test:
name: Full build and integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Install Chrome-Helper
uses: actions-rs/cargo@v1
with:
command: install
args: --path extension/chrome_helper
- name: Install wasm-pack
uses: actions-rs/[email protected]
with:
crate: wasm-pack
version: latest
use-tool-cache: true
- name: Build extension
run: make -C extension packed.zip
- name: Install Chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends google-chrome-stable
- name: Install xvfb
run: sudo apt-get install -y --no-install-recommends xvfb
- name: Take screenshots
run: RUST_LOG=integration_test=debug CHROME="$HOME/.cargo/bin/chrome_helper" xvfb-run -a --server-args="-screen 0 1600x1400x24" make -C extension screenshots
- name: Upload screenshots
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: screenshots
path: extension/*.png
- name: Run tests
run: RUST_LOG=headless_chrome=debug,integration_test=debug CHROME="$HOME/.cargo/bin/chrome_helper" xvfb-run -a --server-args="-screen 0 1600x1400x24" make -C extension test