Skip to content

Commit 974f82a

Browse files
authored
Merge pull request #1 from sir-gon/develop
[Github Actions] coverage splitted
2 parents 9ce9a2a + e20997a commit 974f82a

15 files changed

+884
-17
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
target

.editorconfig

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
trim_trailing_whitespace = true
11+
indent_size = 2
12+
max_line_length = 80
13+
14+
# # Already default setting
15+
# [*.sh]
16+
# indent_size = 4
17+
18+
# # Already default setting
19+
# Same as in .clang-format
20+
# [{*.cpp, *.hpp, *.S}]
21+
# indent_size = 4
22+
23+
# # Already default setting
24+
# [{*.ld, *.lds}]
25+
# indent_size = 4
26+
27+
[*.nix]
28+
indent_size = 2
29+
30+
[*.toml]
31+
indent_size = 2
32+
33+
[*.yml]
34+
indent_size = 2
35+
36+
[*.json]
37+
indent_size = 2
38+
39+
[{CMakeLists.txt,*.cmake}]
40+
indent_size = 2
41+
42+
[{Makefile,**.mk}]
43+
# Use tabs for indentation (Makefiles require tabs)
44+
indent_style = tab
45+
indent_size = 2

.github/workflows/gitleaks.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
3+
name: gitleaks
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
push:
8+
workflow_dispatch:
9+
schedule:
10+
# ┌───────────── minute (0 - 59)
11+
# │ ┌───────────── hour (0 - 23)
12+
# │ │ ┌───────────── day of the month (1 - 31)
13+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
14+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# │ │ │ │ │
18+
# * * * * *
19+
- cron: "0 6 * * *" # run once a day at 6 AM
20+
jobs:
21+
scan:
22+
name: gitleaks
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0
28+
- uses: gitleaks/gitleaks-action@v2
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
# Only required for Organizations, not personal accounts.
32+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Markdown Lint
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
permissions: read-all
13+
14+
jobs:
15+
markdownlint:
16+
name: Markdown Lint
17+
runs-on: ubuntu-24.04
18+
19+
strategy:
20+
matrix:
21+
node-version: [22.x]
22+
# See supported Node.js release schedule
23+
# at https://nodejs.org/en/about/releases/
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
28+
29+
- name: Set up Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v5
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Install dependencies
35+
run: npm install -g markdownlint-cli
36+
37+
- name: Lint
38+
run: >
39+
markdownlint '**/*.md' --ignore node_modules
40+
&& echo '✔ Your code looks good.'
Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
---
12
name: Coverage
23

3-
on: [pull_request, push]
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
411

512
jobs:
613
coverage:
@@ -13,11 +20,70 @@ jobs:
1320
run: rustup update stable
1421
- name: Install cargo-llvm-cov
1522
uses: taiki-e/install-action@cargo-llvm-cov
23+
- name: Install Clippy
24+
run: rustup component add clippy
25+
- name: Install cargo-sonar and run Clippy
26+
run: |
27+
cargo install cargo-sonar
28+
cargo clippy --message-format json > my-clippy-report.json
29+
cargo sonar --clippy --clippy-path my-clippy-report.json
1630
- name: Generate code coverage
17-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
18-
- name: Upload coverage to Codecov
19-
uses: codecov/codecov-action@v3
31+
run: >
32+
cargo llvm-cov
33+
--all-features
34+
--workspace
35+
--lcov
36+
--output-path lcov.info
37+
- name: Upload coverage artifact
38+
uses: actions/upload-artifact@v4
2039
with:
21-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
22-
files: lcov.info
23-
fail_ci_if_error: true
40+
name: coverage-report
41+
path: |
42+
lcov.info
43+
sonar-issues.json
44+
45+
codecov:
46+
name: Upload to Codecov
47+
runs-on: ubuntu-24.04
48+
needs: coverage
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v5
53+
with:
54+
fetch-depth: 0
55+
- name: Download coverage artifact
56+
uses: actions/download-artifact@v5
57+
with:
58+
name: coverage-report
59+
60+
- name: Upload coverage reports to Codecov with GitHub Action
61+
uses: codecov/codecov-action@v5
62+
with:
63+
files: coverage.out
64+
token: ${{ secrets.CODECOV_TOKEN }} # required
65+
verbose: true # optional (default = false)
66+
67+
sonarqube:
68+
name: SonarQube
69+
runs-on: ubuntu-latest
70+
needs: coverage
71+
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@v5
75+
with:
76+
fetch-depth: 0
77+
- name: Download coverage artifact
78+
uses: actions/download-artifact@v5
79+
with:
80+
name: coverage-report
81+
- name: SonarCloud Scan
82+
uses: SonarSource/sonarqube-scan-action@master
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
86+
with:
87+
args: >
88+
-Dsonar.externalIssuesReportPaths=sonar-issues.json
89+
-Dcommunity.rust.lcov.reportPaths=lcov.info

.github/workflows/rust.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1+
---
12
name: Rust
23

3-
on:
4+
on: # yamllint disable-line rule:truthy
45
push:
5-
branches: [ "main" ]
6+
branches: ["main"]
67
pull_request:
7-
branches: [ "main" ]
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
811

912
env:
1013
CARGO_TERM_COLOR: always
1114

1215
jobs:
1316
build:
14-
15-
runs-on: ubuntu-24.04
17+
name: "RUST Build and Test"
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: ["windows-2022", "ubuntu-24.04", "macos-14"]
22+
runs-on: ${{ matrix.os }}
1623

1724
steps:
18-
- uses: actions/checkout@v4
19-
- name: Build
20-
run: cargo build --verbose
21-
- name: Run tests
22-
run: cargo test --verbose
25+
- uses: actions/checkout@v4
26+
- name: Build
27+
run: cargo build --verbose
28+
- name: Run tests
29+
run: cargo test --verbose

.github/workflows/yamllint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
name: YAML lint
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches: ["main"]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: ["main"]
11+
workflow_dispatch:
12+
13+
jobs:
14+
lint:
15+
name: YAML lint
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
20+
21+
- name: Install yamllint
22+
run: pip install yamllint
23+
24+
- name: Lint YAML files
25+
run: >
26+
yamllint --strict .
27+
&& echo '✔ Your code looks good.'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
my-clippy-report.json
2+
sonar-issues.json
13
/target
24

35

0 commit comments

Comments
 (0)