-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (102 loc) · 2.96 KB
/
Copy pathbuild.yml
File metadata and controls
120 lines (102 loc) · 2.96 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build Package CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
beta_release:
description: Create beta release
type: boolean
default: false
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && 'main' || github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip || steps.defaults.outputs.skip }}
steps:
- uses: withgraphite/graphite-ci-action@v0.0.9
id: check_skip
continue-on-error: true
with:
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
check:
name: Check
runs-on: ubuntu-latest
needs: [optimize_ci]
if: ${{ needs.optimize_ci.outputs.skip != 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Check for errors
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --tests
env:
RUST_BACKTRACE: 1
test:
name: Test
runs-on: ubuntu-latest
needs: [optimize_ci]
if: ${{ needs.optimize_ci.outputs.skip != 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --locked --tests
env:
RUST_BACKTRACE: 1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo build
run: cargo build --workspace --verbose
- name: cargo test
run: cargo llvm-cov --all-features --workspace --lcov --output-path target/lcov.info
- uses: qltysh/qlty-action/coverage@main
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: target/lcov.info
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy
- name: Run clippy
shell: bash
run: |
cargo clippy --tests --message-format=json -- > clippy_report.json
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Sonar Scan
shell: bash
run: |
sonar-scanner -Dcommunity.rust.clippy.reportPaths=clippy_report.json -Dsonar.login=${{ secrets.SONAR_TOKEN }}