Skip to content

Commit 478960e

Browse files
authored
Use reusable workflow (#111)
1 parent ea7dbd3 commit 478960e

7 files changed

Lines changed: 130 additions & 406 deletions

File tree

.github/workflows/build.yml

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

.github/workflows/ci.yml

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

.github/workflows/markdown.yml

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,12 @@ on:
77
- '.github/markdownlint.jsonc'
88
- '**/*.md'
99

10-
# Declare default permissions as read only.
1110
permissions: read-all
1211

1312
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 CHANGELOG.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'
13+
markdown-check:
14+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/markdown-lint.yml@v1.0.1
15+
with:
16+
lint-config: '.github/markdownlint.jsonc'
17+
link-check-config: '.github/markdown-link-check.jsonc'
18+
ignore-files: 'third_party_licenses.md,CHANGELOG.md'

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ on:
66
- "v*"
77

88
jobs:
9-
test:
10-
uses: Open-CMSIS-Pack/vidx2pidx/.github/workflows/test.yml@main
9+
build-and-verify:
10+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.1
11+
with:
12+
program: cpackget
13+
test-matrix: '[{"platform":"windows-2022","arch":"amd64"},{"platform":"ubuntu-24.04","arch":"amd64"}]'
14+
go-version-file: ./go.mod
15+
enable-qlty-coverage: false
1116

1217
goreleaser:
13-
needs: test
18+
needs: [ build-and-verify ]
1419
permissions:
1520
contents: write
1621
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)