Skip to content

Commit 1ae25fa

Browse files
committed
2 parents e97132f + f54d5fb commit 1ae25fa

File tree

12 files changed

+302
-71
lines changed

12 files changed

+302
-71
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: d.o.it
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/auto-merge.yml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,51 @@
1-
# Source: https://nicolasiensen.github.io/2022-07-23-automating-dependency-updates-with-dependabot-github-auto-merge-and-github-actions/
2-
name: Dependabot auto-merge
3-
on: pull_request_target
1+
name: Dependabot Auto-merge
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
46

57
permissions:
68
pull-requests: write
79
contents: write
10+
checks: read
811

912
jobs:
10-
review-dependabot-pr:
13+
dependabot-auto-merge:
1114
runs-on: ubuntu-latest
12-
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
15+
if: github.event.pull_request.user.login == 'dependabot[bot]'
16+
1317
steps:
1418
- name: Dependabot metadata
1519
id: metadata
1620
uses: dependabot/fetch-metadata@v2
1721
with:
1822
github-token: "${{ secrets.GITHUB_TOKEN }}"
1923

20-
- name: Enable auto-merge for Dependabot PRs
21-
run: gh pr merge --auto --merge "$PR_URL"
22-
env:
23-
PR_URL: ${{github.event.pull_request.html_url}}
24-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
- name: Wait for status checks
25+
uses: lewagon/wait-on-check-action@v1.3.4
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha }}
28+
check-name: 'Run Tests'
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
wait-interval: 30
31+
allowed-conclusions: success
2532

26-
- name: Approve patch and minor updates
27-
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}}
28-
run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**"
33+
- name: Enable auto-merge for patch/minor updates
34+
if: |
35+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
36+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
37+
run: |
38+
gh pr merge --auto --squash "$PR_URL"
39+
gh pr review "$PR_URL" --approve -b "✅ Auto-approving ${{ steps.metadata.outputs.update-type }} update after tests passed"
2940
env:
30-
PR_URL: ${{github.event.pull_request.html_url}}
31-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32-
33-
- name: Comment on major updates of any dependencies
34-
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major'}}
41+
PR_URL: ${{ github.event.pull_request.html_url }}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Label major updates
45+
if: steps.metadata.outputs.update-type == 'version-update:semver-major'
3546
run: |
36-
gh pr comment $PR_URL --body "I'm **not approving** this PR because **it includes a major update of a dependency**"
37-
gh pr edit $PR_URL --add-label "requires-manual-qa"
47+
gh pr comment "$PR_URL" --body "⚠️ Major update detected. Manual review required."
48+
gh pr edit "$PR_URL" --add-label "requires-manual-qa"
3849
env:
39-
PR_URL: ${{github.event.pull_request.html_url}}
40-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
50+
PR_URL: ${{ github.event.pull_request.html_url }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/hugo-pages.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Hugo Build and deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
concurrency:
12+
group: pages
13+
cancel-in-progress: false
14+
defaults:
15+
run:
16+
shell: bash
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
env:
21+
DART_SASS_VERSION: 1.93.2
22+
GO_VERSION: 1.25.1
23+
HUGO_VERSION: 0.151.0
24+
NODE_VERSION: 22.18.0
25+
TZ: Europe/Oslo
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v5
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
- name: Setup Go
33+
uses: actions/setup-go@v5
34+
with:
35+
go-version: ${{ env.GO_VERSION }}
36+
cache: false
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: ${{ env.NODE_VERSION }}
41+
- name: Setup Pages
42+
id: pages
43+
uses: actions/configure-pages@v5
44+
- name: Create directory for user-specific executable files
45+
run: |
46+
mkdir -p "${HOME}/.local"
47+
- name: Install Dart Sass
48+
run: |
49+
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
50+
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
51+
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
52+
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
53+
- name: Install Hugo
54+
run: |
55+
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
56+
mkdir "${HOME}/.local/hugo"
57+
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
58+
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
59+
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
60+
- name: Verify installations
61+
run: |
62+
echo "Dart Sass: $(sass --version)"
63+
echo "Go: $(go version)"
64+
echo "Hugo: $(hugo version)"
65+
echo "Node.js: $(node --version)"
66+
- name: Install Node.js dependencies
67+
run: |
68+
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
69+
- name: Configure Git
70+
run: |
71+
git config core.quotepath false
72+
- name: Cache restore
73+
id: cache-restore
74+
uses: actions/cache/restore@v4
75+
with:
76+
path: ${{ runner.temp }}/hugo_cache
77+
key: hugo-${{ github.run_id }}
78+
restore-keys:
79+
hugo-
80+
- name: Build the site
81+
run: |
82+
hugo \
83+
--gc \
84+
--minify \
85+
--baseURL "${{ steps.pages.outputs.base_url }}/" \
86+
--cacheDir "${{ runner.temp }}/hugo_cache"
87+
- name: Cache save
88+
id: cache-save
89+
uses: actions/cache/save@v4
90+
with:
91+
path: ${{ runner.temp }}/hugo_cache
92+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
93+
- name: Upload artifact
94+
uses: actions/upload-pages-artifact@v3
95+
with:
96+
path: ./public
97+
deploy:
98+
environment:
99+
name: github-pages
100+
url: ${{ steps.deployment.outputs.page_url }}
101+
runs-on: ubuntu-latest
102+
needs: build
103+
steps:
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
11
name: Release
2+
23
on:
4+
workflow_run:
5+
workflows: ["Test"]
6+
types: [completed]
7+
branches: [main]
38
workflow_dispatch:
4-
push:
5-
branches:
6-
- main
9+
inputs:
10+
force:
11+
description: 'Force release even if tests failed'
12+
required: false
13+
default: false
14+
type: boolean
715

816
jobs:
17+
check-tests:
18+
name: Check Test Status
19+
runs-on: ubuntu-latest
20+
outputs:
21+
tests-passed: ${{ steps.check.outputs.tests-passed }}
22+
23+
steps:
24+
- name: Check test workflow status
25+
id: check
26+
run: |
27+
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]] || [[ "${{ inputs.force }}" == "true" ]]; then
28+
echo "tests-passed=true" >> $GITHUB_OUTPUT
29+
echo "✅ Tests passed or force release requested"
30+
else
31+
echo "tests-passed=false" >> $GITHUB_OUTPUT
32+
echo "❌ Tests failed. Release blocked."
33+
exit 1
34+
fi
35+
936
release:
10-
name: Create release
37+
name: Create Release
38+
needs: check-tests
1139
runs-on: ubuntu-latest
40+
if: needs.check-tests.outputs.tests-passed == 'true'
1241

1342
steps:
1443
- name: Checkout repository
15-
uses: actions/checkout@v5
44+
uses: actions/checkout@v4
1645
with:
1746
fetch-depth: 0
18-
# Make sure the release step uses its own credentials
1947
persist-credentials: false
2048

21-
- name: Set up Node.js
49+
- name: Setup Node.js
2250
uses: actions/setup-node@v4
2351
with:
2452
node-version: "lts/*"
53+
cache: 'npm'
2554

26-
- name: Perform clean install of npm
55+
- name: Install dependencies
2756
run: npm ci
2857

2958
- name: Create release
3059
env:
3160
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GIT }}
3261
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3362
run: npx semantic-release
63+
64+
- name: Notify success
65+
if: success()
66+
run: echo "🚀 Release completed successfully"

.github/workflows/test.yml

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,70 @@
1-
name: Playwright Test
1+
name: Test
22

33
on:
44
workflow_dispatch:
55
push:
6-
tags:
7-
- v*
86
branches: [main]
9-
7+
pull_request:
8+
branches: [main]
109

1110
jobs:
12-
build:
11+
test:
12+
name: Run Tests
13+
timeout-minutes: 60
14+
runs-on: ubuntu-latest
15+
1316
strategy:
1417
fail-fast: false
1518
matrix:
16-
os: [macos-latest, windows-latest, ubuntu-latest]
1719
node-version: [20.x, 22.x]
18-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19-
20-
runs-on: ${{ matrix.os }}
2120

2221
steps:
2322
- name: Checkout repository
24-
uses: actions/checkout@v5
25-
with:
26-
fetch-depth: 1 # Fetch only the latest commit for faster builds
27-
28-
- name: Install Go
29-
uses: actions/setup-go@v6
23+
uses: actions/checkout@v4
3024
with:
31-
go-version: ">1.0.0"
32-
cache: true
25+
fetch-depth: 1
3326

3427
- name: Setup Node.js ${{ matrix.node-version }}
3528
uses: actions/setup-node@v4
3629
with:
3730
node-version: ${{ matrix.node-version }}
3831
cache: 'npm'
39-
cache-dependency-path: '**/package-lock.json'
4032

41-
- name: Perform clean install of npm
33+
- name: Setup Go
34+
uses: actions/setup-go@v6
35+
with:
36+
go-version: "stable"
37+
cache: true
38+
39+
- name: Install dependencies
4240
run: npm ci
4341

4442
- name: Install Playwright Browsers
45-
run: npx playwright install
43+
run: npx playwright install --with-deps
4644

47-
- name: Run tests
45+
- name: Run unit tests
4846
run: npm run test
4947

5048
- name: Run Playwright tests
51-
run: npm run test:playwright
49+
run: npx playwright test
50+
51+
- name: Upload test results
52+
uses: actions/upload-artifact@v4
53+
if: ${{ !cancelled() }}
54+
with:
55+
name: test-results-${{ matrix.node-version }}
56+
path: |
57+
playwright-report/
58+
test-results/
59+
retention-days: 30
60+
61+
# Quality gates job
62+
quality-check:
63+
name: Quality Gates
64+
needs: test
65+
runs-on: ubuntu-latest
66+
if: success()
67+
68+
steps:
69+
- name: All tests passed
70+
run: echo "✅ All test matrices completed successfully"

0 commit comments

Comments
 (0)