-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.12 KB
/
ci.yaml
File metadata and controls
50 lines (41 loc) · 1.12 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
name: image-build-push
on:
push:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
lint-and-test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v6
- name: Install asdf & tools
uses: asdf-vm/actions/install@v4
- uses: actions/cache@v5
with:
path: |
~/.asdf/installs/golang
~/.asdf/plugins/golang
~/.asdf/installs/golang/*/packages/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
key: ${{ runner.os }}-golangci-${{ hashFiles('**/go.sum') }}
- name: Run golangci-lint
run: |
set -x
golangci-lint cache status
golangci-lint run --timeout=10m
- name: Test
run: |
set -x
go test -tags dev ./...
- name: Build
run: |
set -x
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -extldflags '-static'" -o createos main.go
ldd createos || true