-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (92 loc) · 2.63 KB
/
ci.yml
File metadata and controls
94 lines (92 loc) · 2.63 KB
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
name: 'Test'
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "develop" ]
env:
CARGO_TERM_COLOR: always
jobs:
rust-test:
name: 'Run nextest'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Install Tauri dependencies'
run: |
sudo apt update && sudo apt install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
webkit2gtk-driver \
xvfb
- name: 'Set up Rust'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: 'Cache Rust dependencies'
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-on-failure: true
- name: 'Install nextest'
uses: taiki-e/install-action@nextest
- name: 'Install cargo-llvm-cov'
uses: taiki-e/install-action@cargo-llvm-cov
- name: 'Run tests with coverage'
run: cd src-tauri/ && cargo llvm-cov nextest --profile ci --lcov --output-path ../coverage-rust.lcov
- name: 'Upload TypeScript bindings'
uses: actions/upload-artifact@v4
with:
name: typescript-bindings
path: src/lib/api/gen/
retention-days: 1
- name: 'Upload Rust coverage to Codecov'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage-rust.lcov
flags: rust
name: rust-coverage
svelte-test:
name: 'Run vitest'
runs-on: ubuntu-latest
needs: rust-test
permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: 'Download TypeScript bindings'
uses: actions/download-artifact@v4
with:
name: typescript-bindings
path: src/lib/api/gen/
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: 'Install Deps'
run: npm ci
- name: 'Test'
run: npm run test:ci
- name: 'Upload Svelte coverage to Codecov'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
flags: svelte
name: svelte-coverage