Skip to content

Commit 1c34bd2

Browse files
feat: add dotenv action to load environment variables (#632)
* feat: add dotenv action to load environment variables * fix: update dotenv action path and add environment variables file * refactor into workflow, not action * refactor: reorganize GitHub workflows for OS-specific testing * refactor: migrate BSD tests to reusable workflow structure * refactor: standardize workflow names and update OS-specific configurations * refactor: integrate dotenv action for dynamic Go version setup in workflows * refactor: add documentation build badge to README
1 parent d37d8e7 commit 1c34bd2

19 files changed

Lines changed: 383 additions & 228 deletions

.github/workflows/BSD-tests.yml

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

.github/workflows/build.yml

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

.github/workflows/codeql.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,19 @@ jobs:
5050
- name: Checkout repository
5151
uses: actions/checkout@v6
5252

53-
- name: Set up Go (latest version)
53+
- name: Dotenv Action
54+
id: dotenv
55+
uses: falti/dotenv-action@v1
56+
with:
57+
path: .github/workflows/env
58+
log-variables: true
59+
60+
- name: Set up Go ${{ steps.dotenv.outputs.go_version }}
5461
uses: actions/setup-go@v6
5562
with:
56-
go-version: '>=1.26.0'
63+
go-version: ${{ steps.dotenv.outputs.go_version }}
5764
check-latest: true
65+
cache: true
5866

5967
# Initializes the CodeQL tools for scanning.
6068
- name: Initialize CodeQL

.github/workflows/doc.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Documentation Build
1+
name: Build Documentation
22

33
on:
44
workflow_dispatch:
@@ -23,10 +23,19 @@ jobs:
2323
submodules: true # Fetch Hugo themes (true OR recursive)
2424
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
2525

26-
- name: Set up Go
26+
- name: Dotenv Action
27+
id: dotenv
28+
uses: falti/dotenv-action@v1
29+
with:
30+
path: .github/workflows/env
31+
log-variables: true
32+
33+
- name: Set up Go ${{ steps.dotenv.outputs.go_version }}
2734
uses: actions/setup-go@v6
2835
with:
29-
go-version: ~1.26
36+
go-version: ${{ steps.dotenv.outputs.go_version }}
37+
check-latest: true
38+
cache: true
3039

3140
- name: Check configuration snippets in documentation
3241
run: go run ./config/checkdoc -r docs/content -i changelog.md

.github/workflows/docker.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
goreleaser:
11+
name: Rebuild docker image
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout
@@ -21,11 +22,19 @@ jobs:
2122
export LATEST_TAG=`git describe --tags --abbrev=0`
2223
git checkout $LATEST_TAG
2324
24-
- name: Set up Go
25+
- name: Dotenv Action
26+
id: dotenv
27+
uses: falti/dotenv-action@v1
28+
with:
29+
path: .github/workflows/env
30+
log-variables: true
31+
32+
- name: Set up Go ${{ steps.dotenv.outputs.go_version }}
2533
uses: actions/setup-go@v6
2634
with:
27-
go-version: ~1.26
35+
go-version: ${{ steps.dotenv.outputs.go_version }}
2836
check-latest: true
37+
cache: true
2938

3039
- name: Set up QEMU
3140
uses: docker/setup-qemu-action@v4

.github/workflows/env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
go_version=1.26
2+
lint_version=v2.11.4

.github/workflows/freebsd.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test on FreeBSD
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
paths-ignore:
8+
- 'docs/**'
9+
10+
pull_request:
11+
types: [opened, synchronize, reopened]
12+
paths-ignore:
13+
- 'docs/**'
14+
15+
jobs:
16+
build:
17+
name: Run tests
18+
strategy:
19+
matrix:
20+
freebsd_version: ['14.3', '15.0']
21+
uses: ./.github/workflows/run-tests-vm.yml
22+
with:
23+
os: 'freebsd'
24+
os_version: '${{ matrix.freebsd_version }}'
25+
secrets: inherit

.github/workflows/macos.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test on macOS
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- 'docs/**'
8+
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
paths-ignore:
12+
- 'docs/**'
13+
14+
jobs:
15+
build:
16+
name: Build and run tests on macOS
17+
uses: ./.github/workflows/run-tests-os.yml
18+
with:
19+
os: 'macos-latest'
20+
secrets: inherit

.github/workflows/netbsd.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test on NetBSD
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
paths-ignore:
8+
- 'docs/**'
9+
10+
pull_request:
11+
types: [opened, synchronize, reopened]
12+
paths-ignore:
13+
- 'docs/**'
14+
15+
jobs:
16+
build:
17+
name: Run tests
18+
strategy:
19+
matrix:
20+
netbsd_version: ['10.1']
21+
uses: ./.github/workflows/run-tests-vm.yml
22+
with:
23+
os: 'netbsd'
24+
os_version: '${{ matrix.netbsd_version }}'
25+
secrets: inherit

.github/workflows/openbsd.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test on OpenBSD
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
paths-ignore:
8+
- 'docs/**'
9+
10+
pull_request:
11+
types: [opened, synchronize, reopened]
12+
paths-ignore:
13+
- 'docs/**'
14+
15+
jobs:
16+
build:
17+
name: Run tests
18+
strategy:
19+
matrix:
20+
openbsd_version: ['7.8']
21+
uses: ./.github/workflows/run-tests-vm.yml
22+
with:
23+
os: 'openbsd'
24+
os_version: '${{ matrix.openbsd_version }}'
25+
secrets: inherit

0 commit comments

Comments
 (0)