-
Notifications
You must be signed in to change notification settings - Fork 146
84 lines (80 loc) · 2.55 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
---
name: CI
on:
pull_request:
push:
jobs:
test:
name: Test
runs-on: ubuntu-latest
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
container:
image: quay.io/prometheus/golang-builder:1.22-base
steps:
- uses: actions/checkout@v4
- uses: prometheus/promci@v0.4.4
- uses: ./.github/promci/actions/setup_environment
- run: make
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
thread: [ 0, 1, 2 ]
steps:
- uses: actions/checkout@v4
- uses: prometheus/promci@v0.4.4
- uses: ./.github/promci/actions/build
with:
parallelism: 3
thread: ${{ matrix.thread }}
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '<1.22'
- name: Lint
uses: golangci/golangci-lint-action@v6.1.0
with:
# Keep in sync with Makefile.common
version: v1.56.2
# modified from the original as this repo still using master, insteead of main
publish_master:
name: Publish master branch artifacts
runs-on: ubuntu-latest
needs: [test, build]
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: prometheus/promci@v0.4.4
- uses: ./.github/promci/actions/publish_main
with:
docker_hub_organization: lusotycoon
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: lusitaniae
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
publish_release:
name: Publish release arfefacts
runs-on: ubuntu-latest
needs: [test, build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: prometheus/promci@v0.4.4
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_organization: lusotycoon
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: lusitaniae
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}