Repository navigation
95 lines (80 loc) · 2.45 KB
/
Copy pathtest.yml
File metadata and controls
95 lines (80 loc) · 2.45 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
95
name: Test backend
on:
push:
branches:
- main
- dev
- "release/**"
- "stable/**"
paths-ignore:
- "*.md"
- "LICENSE"
pull_request:
branches:
- main
- dev
- "release/**"
- "stable/**"
paths-ignore:
- "*.md"
- "LICENSE"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: "1"
# sccache
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
test:
runs-on:
- codebuild-defguard-client-runner-${{ github.run_id }}-${{ github.run_attempt }}
container:
image: public.ecr.aws/docker/library/rust:1
options: --user root
defaults:
run:
working-directory: ./src-tauri
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
submodules: recursive
- name: Scan code with Trivy
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
env:
TRIVY_SHOW_SUPPRESSED: 1
TRIVY_IGNOREFILE: "./.trivyignore.yaml"
with:
scan-type: "fs"
scan-ref: "."
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL,HIGH,MEDIUM"
scanners: "vuln"
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
- name: Install required packages
run: |
apt-get update
apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libudev-dev libxdo-dev unzip protobuf-compiler
- name: Check format
run: |
rustup component add rustfmt
cargo fmt --all -- --check
- name: Run clippy linter
run: |
mkdir ../dist
rustup component add clippy
cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Install cargo extensions
uses: taiki-e/install-action@v2
with:
tool: cargo-deny,cargo-nextest
- name: Run cargo deny
working-directory: ./src-tauri
run: cargo deny check --hide-inclusion-graph
- name: Run tests
run: cargo nextest run --workspace --locked --no-fail-fast