-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (78 loc) · 2.18 KB
/
ci.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
name: Lint and Test
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- '.gitignore'
pull_request:
paths-ignore:
- 'README.md'
- '.gitignore'
jobs:
lint:
name: lint
strategy:
matrix:
toolchain: [stable]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache toolchain
uses: Swatinem/rust-cache@v1
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy
- name: Check build
run: |
make check
- name: Lint
run: |
make lint
test:
name: test
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
toolchain: [stable]
deno_version: [v1.x]
runs-on: ${{ matrix.os }}
steps:
- name: Install XQuartz on macOS
if: runner.os == 'macOS'
run: brew install xquartz
- name: Install xvfb
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install xvfb xclip
- uses: actions/checkout@v2
- name: Cache toolchain
uses: Swatinem/rust-cache@v1
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno_version }}
- name: Install deno_bindgen
run: |
# FIXME: Install from GitHub as the latest commit supports FFI destructive changes but has not been released.
# deno install -Afq -n deno_bindgen https://deno.land/x/deno_bindgen/cli.ts
deno install -Afq -n deno_bindgen https://raw.githubusercontent.com/denoland/deno_bindgen/main/cli.ts
- name: Test in macOS and Windows
if: runner.os != 'Linux'
run: |
make test
- name: Test in Linux
if: runner.os == 'Linux'
run: |
# NOTE: Currently FFI tests do not work properly on Linux
# See #2
xvfb-run make deno-test