-
Notifications
You must be signed in to change notification settings - Fork 22
93 lines (81 loc) · 2.43 KB
/
Copy pathgo.yml
File metadata and controls
93 lines (81 loc) · 2.43 KB
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
name: Build Status
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ['1.25.x', '1.26.x']
runs-on: ${{ matrix.os }}
name: test (${{ matrix.os }}, go ${{ matrix.go-version }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Install Dart Sass
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
wget -qO- https://github.com/sass/dart-sass/releases/download/1.80.7/dart-sass-1.80.7-linux-x64.tar.gz | tar -xz
echo "$GITHUB_WORKSPACE/dart-sass" >> $GITHUB_PATH
elif [ "$RUNNER_OS" = "macOS" ]; then
wget -qO- https://github.com/sass/dart-sass/releases/download/1.80.7/dart-sass-1.80.7-macos-x64.tar.gz | tar -xz
echo "$GITHUB_WORKSPACE/dart-sass" >> $GITHUB_PATH
elif [ "$RUNNER_OS" = "Windows" ]; then
curl -LO https://github.com/sass/dart-sass/releases/download/1.80.7/dart-sass-1.80.7-windows-x64.zip
unzip -q dart-sass-1.80.7-windows-x64.zip
echo "$GITHUB_WORKSPACE/dart-sass" >> $GITHUB_PATH
fi
shell: bash
- name: Build
run: go build main.go
- name: Test
run: go test ./...
# format-check:
# name: Format Check
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: '1.25.x'
#
# - name: Check formatting
# run: |
# go fmt ./...
# if [ -n "$(git status --porcelain)" ]; then
# echo "Code is not formatted. Please run 'go fmt ./...'"
# git diff
# exit 1
# fi
#
# TODO: Re-enable after formatting code in separate PR
verify-mod:
name: Verify go.mod
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- name: Check go.mod and go.sum
run: |
go mod tidy
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
echo "go.mod or go.sum is not up to date. Please run 'go mod tidy'"
git diff go.mod go.sum
exit 1
fi