Skip to content

Commit 0772b7b

Browse files
authored
Use shared workflows (#197)
* Use shared workflows * Changing CRLF to LF for consistency
1 parent ea366a9 commit 0772b7b

4 files changed

Lines changed: 70 additions & 119 deletions

File tree

.github/markdownlint.json

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

.github/workflows/markdown.yml

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,9 @@ concurrency:
1616
permissions: read-all
1717

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

.github/workflows/release.yml

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
name: Release
2-
3-
on:
4-
push:
5-
tags:
6-
- "*"
7-
8-
jobs:
9-
test:
10-
uses: Open-CMSIS-Pack/generator-bridge/.github/workflows/test.yml@main
11-
12-
goreleaser:
13-
runs-on: ubuntu-latest
14-
needs: test
15-
permissions:
16-
contents: write # for goreleaser/goreleaser-action to create a GitHub release
17-
steps:
18-
- name: Harden Runner
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
test:
10+
uses: Open-CMSIS-Pack/generator-bridge/.github/workflows/test.yml@main
11+
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
needs: test
15+
permissions:
16+
contents: write # for goreleaser/goreleaser-action to create a GitHub release
17+
steps:
18+
- name: Harden Runner
1919
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
20-
with:
21-
egress-policy: audit
22-
23-
- name: Download test results
24-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
25-
with:
26-
pattern: test-results-*
27-
path: testreport/
28-
29-
- name: Zip test reports
30-
run: |
31-
zip -r testreport.zip testreport
32-
33-
- name: Attach test report to release assets
34-
if: startsWith(github.ref, 'refs/tags/')
35-
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
36-
with:
37-
repo_token: ${{ secrets.GITHUB_TOKEN }}
38-
file: testreport.zip
39-
tag: ${{ github.ref }}
40-
overwrite: true
41-
42-
- name: Checkout
43-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44-
45-
- name: Install Go
46-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
47-
with:
48-
go-version-file: go.mod
49-
check-latest: true
50-
51-
- name: Run GoReleaser
52-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
53-
with:
54-
distribution: goreleaser
55-
version: "~> v2"
56-
args: release --clean
57-
env:
58-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
20+
with:
21+
egress-policy: audit
22+
23+
- name: Download test results
24+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
25+
with:
26+
pattern: test-results-*
27+
path: testreport/
28+
29+
- name: Zip test reports
30+
run: |
31+
zip -r testreport.zip testreport
32+
33+
- name: Attach test report to release assets
34+
if: startsWith(github.ref, 'refs/tags/')
35+
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
36+
with:
37+
repo_token: ${{ secrets.GITHUB_TOKEN }}
38+
file: testreport.zip
39+
tag: ${{ github.ref }}
40+
overwrite: true
41+
42+
- name: Checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
45+
- name: Install Go
46+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
47+
with:
48+
go-version-file: go.mod
49+
check-latest: true
50+
51+
- name: Run GoReleaser
52+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
53+
with:
54+
distribution: goreleaser
55+
version: "~> v2"
56+
args: release --clean
57+
env:
58+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ jobs:
171171
path: ./build/${{ env.program }}-testreport-*.xml
172172
retention-days: 1
173173
if-no-files-found: error
174-
174+
175+
html-test-report:
176+
needs: [ test ]
177+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/generate-junit-to-html-report.yml@main
178+
with:
179+
report_header: cbridge
180+
175181
publish-test-results:
176182
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && github.workflow != 'Release' }}
177183
name: "Publish Tests Results"

0 commit comments

Comments
 (0)