forked from p4lang/p4analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 1.77 KB
/
ci.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
on:
push:
branches:
- main
pull_request:
name: Build & test
jobs:
build_and_test:
name: Push/Pull build_and_test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install node-JS 18
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: '1.68'
- name: Install Wasm-Pack
uses: jetli/[email protected]
with:
version: 'v0.11.0'
- name: Restore cached Build
id: cache-restore
uses: actions/cache/restore@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-${{ github.sha }}
restore-keys: ${{ runner.os }}-rust-
- name: Build
run: |
npm ci
npm run build
npm run package
cargo build --all-targets --locked
cargo build --release --locked
- name: Test
run: cargo test --locked
timeout-minutes: 1
- name: Save Build
id: cache-build
uses: actions/cache/save@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: Artifact vsix file
uses: actions/upload-artifact@v3
with:
name: .vsix-file
path: packages/p4-analyzer-vscode/p4-analyzer-vscode-*.vsix
if-no-files-found: error