@@ -3,9 +3,12 @@ name: CI
33on :
44 pull_request :
55 push :
6- branches : [master, 'release-*']
6+ branches : [main, master, 'release-*']
77 tags : ['v*']
88
9+ permissions :
10+ contents : read
11+
912jobs :
1013 test_go :
1114 name : Go tests
@@ -18,61 +21,28 @@ jobs:
1821 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1922 with :
2023 persist-credentials : false
21- - uses : prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
22- - uses : ./.github/promci/actions/setup_environment
23- - run : make
24+ - uses : prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
25+ - run : make GO_ONLY=1 SKIP_GOLANGCI_LINT=1
26+ - run : git diff --exit-code
2427
2528 build :
26- name : Build Prometheus for common architectures
27- runs-on : ubuntu-latest
28- if : |
29- !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
30- &&
31- !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
32- &&
33- !(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
34- &&
35- !(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
36- strategy :
37- matrix :
38- thread : [ 0, 1, 2 ]
39- steps :
40- - uses : prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
41- with :
42- promu_opts : " -p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
43- parallelism : 3
44- thread : ${{ matrix.thread }}
45-
46- build_all :
47- name : Build Prometheus for all architectures
29+ name : Build
4830 runs-on : ubuntu-latest
49- if : |
50- (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
51- ||
52- (github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
53- ||
54- (github.event_name == 'push' && github.event.ref == 'refs/heads/main')
55- ||
56- (github.event_name == 'push' && github.event.ref == 'refs/heads/master')
5731 strategy :
5832 matrix :
59- thread : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
60-
61- # Whenever the Go version is updated here, .promu.yml
62- # should also be updated.
33+ thread : [ 0, 1, 2, 3]
6334 steps :
6435 - uses : prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
6536 with :
66- parallelism : 12
37+ parallelism : 4
6738 thread : ${{ matrix.thread }}
6839
69- publish_main :
70- # https://github.com/prometheus/promci/blob/52c7012f5f0070d7281b8db4a119e21341d43c91/actions/publish_main/action.yml
71- name : Publish main branch artifacts
40+ publish_default :
41+ name : Publish default branch artifacts
7242 runs-on : ubuntu-latest
7343 permissions :
7444 packages : write
75- needs : [test_go, build_all ]
45+ needs : [test_go, build ]
7646 if : |
7747 (github.event_name == 'push' && github.event.ref == 'refs/heads/main')
7848 ||
8151 - uses : prometheus/promci/publish_main@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
8252 with :
8353 docker_hub_organization : prometheuscommunity
84- docker_hub_login : ${{ secrets.docker_hub_login }}
8554 docker_hub_password : ${{ secrets.docker_hub_password }}
8655 ghcr_io_password : ${{ github.token }}
8756 quay_io_organization : prometheuscommunity
88- quay_io_login : ${{ secrets.quay_io_login }}
8957 quay_io_password : ${{ secrets.quay_io_password }}
9058
9159 publish_release :
@@ -94,17 +62,15 @@ jobs:
9462 permissions :
9563 contents : write
9664 packages : write
97- needs : [test_go, build_all ]
65+ needs : [test_go, build ]
9866 if : |
9967 (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
10068 steps :
10169 - uses : prometheus/promci/publish_release@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
10270 with :
10371 docker_hub_organization : prometheuscommunity
104- docker_hub_login : ${{ secrets.docker_hub_login }}
10572 docker_hub_password : ${{ secrets.docker_hub_password }}
10673 ghcr_io_password : ${{ github.token }}
10774 quay_io_organization : prometheuscommunity
108- quay_io_login : ${{ secrets.quay_io_login }}
10975 quay_io_password : ${{ secrets.quay_io_password }}
11076 github_token : ${{ github.token }}
0 commit comments