-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (78 loc) · 2.17 KB
/
build.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
name: Build
on:
push:
branches:
- main
pull_request:
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
jobs:
build:
name: Format, build, clippy, test and doc
runs-on: ubuntu-22.04
container: docker.io/debian:stable
timeout-minutes: 15
strategy:
matrix:
toolchain:
- 1.80.0 # MSRV
- stable
- nightly
steps:
- uses: actions/checkout@v3
- name: Install tools
run: |
apt-get update \
&& apt-get install --assume-yes curl gcc
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- name: Cache Rust crates
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Run rustfmt check
run: cargo fmt -- --check
- name: Build project
run: cargo build
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run tests
run: cargo test -p source_gen -p poc-plpgsql-analyzer --features coverage-tests
- name: Generate rustdoc
run: cargo doc --no-deps
build-wasm:
name: Build WASM library
runs-on: ubuntu-22.04
container: docker.io/debian:stable
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Install tools
run: |
apt-get update \
&& apt-get install --assume-yes \
curl binaryen gcc libssl-dev make pkg-config
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rust-std, rustfmt
targets: wasm32-unknown-unknown
- name: Cache Rust crates
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install wasm-pack
uses: baptiste0928/cargo-install@v1
with:
crate: wasm-pack
version: "0.12.1"
- name: Build using wasm-pack
run: wasm-pack build --release --target nodejs
- uses: actions/upload-artifact@v3
with:
name: wasm-library
path: pkg/