Skip to content

Commit d1726ce

Browse files
committed
chore: reorganize workflows
1 parent 0142509 commit d1726ce

8 files changed

Lines changed: 236 additions & 114 deletions

File tree

.github/workflows/build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
13+
permissions: {}
14+
15+
jobs:
16+
17+
cross:
18+
name: Go Matrix
19+
runs-on: ${{ matrix.os }}
20+
env:
21+
CGO_ENABLED: 0
22+
23+
strategy:
24+
matrix:
25+
go-version: [ oldstable, stable ]
26+
os: [ubuntu-latest, macos-latest, windows-latest]
27+
28+
steps:
29+
- uses: actions/checkout@v6
30+
with:
31+
persist-credentials: false
32+
- uses: actions/setup-go@v6
33+
with:
34+
go-version: ${{ matrix.go-version }}
35+
36+
- name: Test
37+
run: go test -v -cover ./...
38+
39+
- name: Build
40+
run: go build -v -ldflags "-s -w" -trimpath -o ./dist/lego ./
41+
42+
docker:
43+
name: Docker Build
44+
runs-on: ubuntu-latest
45+
env:
46+
GO_VERSION: stable
47+
CGO_ENABLED: 0
48+
49+
steps:
50+
- uses: actions/checkout@v6
51+
with:
52+
fetch-depth: 0
53+
persist-credentials: false
54+
55+
- uses: actions/setup-go@v6
56+
with:
57+
go-version: ${{ env.GO_VERSION }}
58+
59+
- name: Check Dependencies
60+
run: go mod tidy --diff
61+
62+
- name: Generate and Check generated elements
63+
run: |
64+
make generate
65+
git diff --exit-code
66+
67+
- name: Docker image build
68+
run: make build image

.github/workflows/doc-build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Documentation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
9+
permissions: {}
10+
11+
jobs:
12+
13+
build:
14+
name: Build Documentation
15+
runs-on: ubuntu-latest
16+
env:
17+
GO_VERSION: stable
18+
HUGO_VERSION: 0.157.0
19+
steps:
20+
- uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
persist-credentials: false
24+
25+
- uses: actions/setup-go@v6
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: Generate and Check generated elements
30+
run: |
31+
make generate
32+
git diff --exit-code
33+
34+
- name: Install Hugo
35+
run: |
36+
wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-amd64.deb
37+
sudo dpkg -i /tmp/hugo.deb
38+
39+
- name: Build Documentation
40+
run: make docs-build
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Documentation
1+
name: Deploy Documentation
22

33
on:
44
push:
@@ -9,7 +9,7 @@ permissions: {}
99

1010
jobs:
1111

12-
doc:
12+
deploy:
1313
name: Build and deploy documentation
1414
runs-on: ubuntu-latest
1515
permissions:
@@ -28,6 +28,7 @@ jobs:
2828
- uses: actions/setup-go@v6
2929
with:
3030
go-version: ${{ env.GO_VERSION }}
31+
cache: false
3132

3233
- name: Generate DNS docs
3334
run: make generate

.github/workflows/go-cross.yml

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

.github/workflows/pr.yml

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

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ jobs:
5959
username: ${{ vars.DOCKERHUB_USERNAME }}
6060
password: ${{ secrets.DOCKERHUB_TOKEN }}
6161

62-
- name: Install snapcraft
63-
run: sudo snap install snapcraft --classic
64-
6562
- name: Set up QEMU
6663
uses: docker/setup-qemu-action@v4
6764

6865
- name: Set up Docker Buildx
6966
uses: docker/setup-buildx-action@v4
7067

68+
- name: Install snapcraft
69+
run: sudo snap install snapcraft --classic
70+
7171
- name: Setup Syft
7272
uses: anchore/sbom-action/download-syft@v0.24.0
7373

@@ -76,8 +76,8 @@ jobs:
7676
id: goreleaser
7777
uses: goreleaser/goreleaser-action@v7
7878
with:
79-
version: v2.15.4
80-
args: release -p 1 --clean --timeout=90m
79+
version: v2.16.0
80+
args: release -p 2 --clean --timeout=90m
8181
env:
8282
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8383
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

.github/workflows/tests-lint.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Linting and Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
13+
permissions: {}
14+
15+
jobs:
16+
17+
tests:
18+
name: Tests
19+
runs-on: ubuntu-latest
20+
env:
21+
GO_VERSION: stable
22+
GOLANGCI_LINT_VERSION: v2.12
23+
CGO_ENABLED: 0
24+
MEMCACHED_HOSTS: localhost:11211
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
with:
29+
fetch-depth: 0
30+
persist-credentials: false
31+
32+
- uses: actions/setup-go@v6
33+
with:
34+
go-version: ${{ env.GO_VERSION }}
35+
36+
- name: Check Dependencies
37+
run: go mod tidy --diff
38+
39+
- name: Generate and Check generated elements
40+
run: |
41+
make generate
42+
git diff --exit-code
43+
44+
- name: Set up a Memcached server
45+
run: docker run -d --rm -p 11211:11211 memcached:1.6-alpine
46+
47+
- name: Tests
48+
run: make test
49+
50+
e2e-tests:
51+
name: Integration Tests
52+
runs-on: ubuntu-latest
53+
env:
54+
GO_VERSION: stable
55+
CGO_ENABLED: 0
56+
LEGO_E2E_TESTS: CI
57+
58+
steps:
59+
- uses: actions/checkout@v6
60+
with:
61+
fetch-depth: 0
62+
persist-credentials: false
63+
64+
- uses: actions/setup-go@v6
65+
with:
66+
go-version: ${{ env.GO_VERSION }}
67+
68+
- name: Check Dependencies
69+
run: go mod tidy --diff
70+
71+
- name: Generate and Check generated elements
72+
run: |
73+
make generate
74+
git diff --exit-code
75+
76+
- uses: golangci/golangci-lint-action@v9
77+
with:
78+
version: ${{ env.GOLANGCI_LINT_VERSION }}
79+
80+
- name: Install Pebble
81+
run: go install github.com/letsencrypt/pebble/v2/cmd/pebble@v2.10.1
82+
83+
- name: Install challtestsrv
84+
run: go install github.com/letsencrypt/pebble/v2/cmd/pebble-challtestsrv@v2.10.1
85+
86+
- name: Integration Tests
87+
run: make e2e
88+
89+
linting:
90+
name: Linting
91+
runs-on: ubuntu-latest
92+
env:
93+
GO_VERSION: stable
94+
GOLANGCI_LINT_VERSION: v2.12
95+
CGO_ENABLED: 0
96+
LEGO_E2E_TESTS: CI
97+
MEMCACHED_HOSTS: localhost:11211
98+
99+
steps:
100+
- uses: actions/checkout@v6
101+
with:
102+
fetch-depth: 0
103+
persist-credentials: false
104+
105+
- uses: actions/setup-go@v6
106+
with:
107+
go-version: ${{ env.GO_VERSION }}
108+
109+
- name: Check Dependencies
110+
run: go mod tidy --diff
111+
112+
- name: Generate and Check generated elements
113+
run: |
114+
make generate
115+
git diff --exit-code
116+
117+
- uses: golangci/golangci-lint-action@v9
118+
with:
119+
version: ${{ env.GOLANGCI_LINT_VERSION }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: clean checks test build image e2e fmt
1+
.PHONY: clean checks test build image e2e
22

33
export GO111MODULE=on
44
export CGO_ENABLED=0

0 commit comments

Comments
 (0)