Skip to content

Commit 3c688f5

Browse files
committed
Use github actions
First, let us do the same thing with github actions that we do with travis.
1 parent 7af2d61 commit 3c688f5

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 2 * * *'
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
rust: ["stable", "beta", "nightly"]
14+
os: [ubuntu-18.04, macos-latest]
15+
name: Cargo test
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- name: Checkout sources
19+
uses: actions/checkout@v1
20+
- name: Install toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
profile: minimal
24+
toolchain: ${{ matrix.rust }}
25+
override: true
26+
- name: Execute cargo test
27+
run: cargo test --all --tests --examples
28+
wasm_test:
29+
name: Cargo test for wasm
30+
runs-on: ubuntu-18.04
31+
steps:
32+
- name: Checkout sources
33+
uses: actions/checkout@v1
34+
- name: Install toolchain
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
profile: minimal
38+
toolchain: stable
39+
override: true
40+
- name: Setup wasm-bindgen
41+
run: |
42+
rustup target add wasm32-unknown-unknown &&
43+
sudo apt update && sudo apt install -y firefox-geckodriver &&
44+
wget https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.54/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz &&
45+
mkdir wasm-bindgen &&
46+
tar -xzf wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz -C wasm-bindgen
47+
- name: Execute cargo test
48+
run: |
49+
export PATH=$PATH:$PWD/wasm-bindgen/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl &&
50+
xvfb-run cargo test --manifest-path=./graphql_client/Cargo.toml --features="web" --target wasm32-unknown-unknown
51+
lint:
52+
name: Rustfmt and Clippy
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout sources
56+
uses: actions/checkout@v1
57+
- name: Install toolchain
58+
uses: actions-rs/toolchain@v1
59+
with:
60+
profile: minimal
61+
toolchain: stable
62+
override: true
63+
components: clippy,rustfmt
64+
- name: Execute cargo fmt
65+
run: cargo fmt --all -- --check
66+
- name: Execute cargo clippy
67+
run: cargo clippy -- -D warnings
68+
prettier:
69+
name: Check prettier
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Checkout sources
73+
uses: actions/checkout@v1
74+
- name: Install node.js
75+
run: sudo apt update && sudo apt-get install -y nodejs
76+
- name: Execute prettier
77+
run: npx prettier --debug-check -l './**/*.json' './**/*.graphql'

0 commit comments

Comments
 (0)