Skip to content

Commit 754e591

Browse files
authored
Use reusable workflows (#359)
* Use reusable workflows * Added auto update workflow job
1 parent be8a4ac commit 754e591

File tree

8 files changed

+90
-364
lines changed

8 files changed

+90
-364
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
paths:
8+
- '.github/workflows/ci.yml'
9+
- '**/*.go'
10+
- 'makefile'
11+
- 'go.mod'
12+
- 'go.sum'
13+
- '!**/*.md'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
build-and-verify:
24+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.0
25+
secrets:
26+
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
27+
with:
28+
program: cbuild2cmake
29+
go-version-file: ./go.mod
30+
enable-code-climate: true
31+
artifact-retention-days: 7
32+
33+
publish-test-results:
34+
name: "Publish Tests Results"
35+
needs: [ build-and-verify ]
36+
runs-on: ubuntu-latest
37+
permissions:
38+
checks: write
39+
pull-requests: write
40+
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && github.workflow != 'Release' }}
41+
steps:
42+
- name: Harden Runner
43+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
44+
with:
45+
egress-policy: audit
46+
47+
- name: Download Artifacts
48+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
49+
with:
50+
path: artifacts
51+
52+
- name: publish test results
53+
uses: EnricoMi/publish-unit-test-result-action/linux@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0
54+
with:
55+
files: artifacts/**/cbuild2cmake-testreport-*.xml
56+
report_individual_runs: true

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ permissions:
1515
jobs:
1616
dependency-review:
1717
runs-on: ubuntu-latest
18+
if: github.repository_owner == 'Open-CMSIS-Pack'
1819
permissions:
1920
pull-requests: write
2021
steps:
@@ -25,6 +26,7 @@ jobs:
2526

2627
- name: 'Checkout Repository'
2728
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
2830
- name: 'Dependency Review'
2931
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
3032
with:

.github/workflows/markdown.yml

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,9 @@ on:
1111
permissions: read-all
1212

1313
jobs:
14-
lint:
15-
name: Lint markdown files
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Harden Runner
19-
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
20-
with:
21-
egress-policy: audit
22-
23-
- name: Checkout devtools
24-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25-
26-
- name: Register markdownlint warning matcher
27-
run: |
28-
echo "::add-matcher::.github/markdownlint.json"
29-
30-
- name: Lint markdown files
31-
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
32-
with:
33-
args: '**/*.md'
34-
config: '.github/markdownlint.jsonc'
35-
ignore: 'third_party_licenses.md'
36-
37-
- name: Remove markdownlint warning matcher
38-
if: always()
39-
run: |
40-
echo "::remove-matcher owner=markdownlint::"
41-
42-
check-links:
43-
name: Check markdown links
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: Checkout devtools
47-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48-
49-
- name: Check links
50-
uses: gaurav-nelson/github-action-markdown-link-check@3c3b66f1f7d0900e37b71eca45b63ea9eedfce31 # master
51-
# Checks all Markdown files, including those in subfolders,
52-
# as the PR may involve removing referenced Markdown files.
53-
with:
54-
use-quiet-mode: 'yes'
55-
use-verbose-mode: 'yes'
56-
base-branch: ${{ github.base_ref }}
57-
config-file: '.github/markdown-link-check.jsonc'
58-
14+
markdown-check:
15+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/markdown-lint.yml@v1.0.0
16+
with:
17+
lint-config: '.github/markdownlint.jsonc'
18+
link-check-config: '.github/markdown-link-check.jsonc'
19+
ignore-files: 'third_party_licenses.md'

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ on:
1111
- "v*"
1212

1313
jobs:
14-
test:
15-
uses: Open-CMSIS-Pack/cbuild2cmake/.github/workflows/test.yml@main
14+
build-and-verify:
15+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.0
16+
with:
17+
program: cbuild2cmake
18+
go-version-file: ./go.mod
19+
enable-code-climate: false
1620

1721
goreleaser:
18-
needs: test
22+
needs: [ build-and-verify ]
1923
permissions:
2024
contents: write # for goreleaser/goreleaser-action to create a GitHub release
2125
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)