-
-
Notifications
You must be signed in to change notification settings - Fork 76
93 lines (81 loc) · 2.81 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-test-check:
runs-on: ${{ matrix.os }}
strategy:
# Default is true, cancels jobs for other platforms in the matrix if one fails
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
go-version:
- "1.21"
- "1.22"
include:
- os: ubuntu-latest
urlTemplate: "https://github.com/caddyserver/xcaddy/releases/download/{{version}}/xcaddy_{{rawVersion}}_linux_amd64.tar.gz"
name: "xcaddy"
pathInArchive: "xcaddy"
- os: "macos-latest"
urlTemplate: "https://github.com/caddyserver/xcaddy/releases/download/{{version}}/xcaddy_{{rawVersion}}_mac_amd64.tar.gz"
name: "xcaddy"
pathInArchive: "xcaddy"
- os: "windows-latest"
urlTemplate: "https://github.com/caddyserver/xcaddy/releases/download/{{version}}/xcaddy_{{rawVersion}}_windows_amd64.zip"
name: "xcaddy.exe"
pathInArchive: "xcaddy.exe"
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
cache: true
go-version: ${{ matrix.go-version }}
- name: Set up xcaddy
uses: engineerd/[email protected]
with:
name: ${{ matrix.name }}
pathInArchive: ${{ matrix.pathInArchive }}
fromGitHubReleases: "true"
repo: "caddyserver/xcaddy"
version: "latest"
urlTemplate: ${{ matrix.urlTemplate }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
xcaddy build master --output ${{ runner.temp }}/${{ matrix.name }} --with github.com/mholt/caddy-l4=./
# smoking test
echo ''
echo '########'
echo "# ${{ runner.temp }}/${{ matrix.name }} version"
${{ runner.temp }}/${{ matrix.name }} version
echo '########'
echo ''
echo '########'
echo "# ${{ runner.temp }}/${{ matrix.name }} list-modules"
${{ runner.temp }}/${{ matrix.name }} list-modules
echo '########'
echo ''
echo '########'
echo "# ${{ runner.temp }}/${{ matrix.name }} build-info"
${{ runner.temp }}/${{ matrix.name }} build-info
echo '########'
- name: Test
run: |
# TODO:
# github.com/mholt/caddy-l4,
# modules/l4echo,
# modules/l4ssh,
# modules/l4subroute,
# modules/l4tee,
# modules/l4throttle,
# modules/l4tls,
# modules/l4xmpp needs their test files.
go test -v ./...