-
Notifications
You must be signed in to change notification settings - Fork 45
104 lines (87 loc) · 2.53 KB
/
CI.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
94
95
96
97
98
99
100
101
102
103
104
name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Git Config for Unit Tests
run: |
git config --global user.email ci
git config --global user.name ci
git config --global init.defaultBranch main
- name: Run Unit Tests
run: |
make test
goreleaser-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check goreleaser's Configuration
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: check
# release:
# permissions:
# # allow goreleaser to access the Releases API
# contents: write
# # Checks if this is a merge into the main and creates a new release if yes.
# if: github.event_name != 'pull_request'
# needs: [test, lint, goreleaser-check]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Restore Go Modules Cache
# uses: actions/cache@v2
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
# - name: Build binary
# run: |
# make build
# chmod +x ./autotag/autotag
# - name: Autotag Merge Commit
# # TODO: replace this with GitHub Action after #41
# run: |
# ./autotag/autotag
# echo "tags:" && git tag -l
# - name: Install rpm
# run: |
# sudo apt-get -qqy update && sudo apt-get -qqy install rpm
# - name: Docker Login
# uses: docker/login-action@v1
# with:
# registry: quay.io
# username: ${{ secrets.QUAY_USER }}
# password: ${{ secrets.QUAY_PASSWD }}
# - name: Deploy Autotag Release
# # TODO(vtopc): switch to the `goreleaser/goreleaser-action` GHA?
# run: |
# curl -sL https://git.io/goreleaser | bash -s -- --parallelism=2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}