Skip to content

Commit 678d177

Browse files
author
Stefano Torresi
committed
update gha workflows
1 parent eec6b6d commit 678d177

File tree

2 files changed

+75
-86
lines changed

2 files changed

+75
-86
lines changed

.github/workflows/dashboards-ci.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ on:
88
push:
99
branches: [main]
1010
paths:
11-
- 'Makefile'
12-
- 'dashboards/**'
13-
- 'packaging/obs/grafana-ha-cluster-dashboards/**'
14-
- '.github/workflows/dashboards*'
11+
- "Makefile"
12+
- "dashboards/**"
13+
- "packaging/obs/grafana-ha-cluster-dashboards/**"
14+
- ".github/workflows/dashboards*"
1515
pull_request:
1616
paths:
17-
- 'Makefile'
18-
- 'dashboards/**'
19-
- 'packaging/obs/grafana-ha-cluster-dashboards/**'
20-
- '.github/workflows/dashboards*'
17+
- "Makefile"
18+
- "dashboards/**"
19+
- "packaging/obs/grafana-ha-cluster-dashboards/**"
20+
- ".github/workflows/dashboards*"
2121

2222
jobs:
2323
build:
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-node@v1
28-
- run: npm -g install jsonlint
29-
- name: validate JSON
30-
run: find dashboards -name "*.json" -type f -exec jsonlint -c {} \;
26+
- uses: actions/checkout@v3
27+
- uses: actions/setup-node@v1
28+
- run: npm -g install jsonlint
29+
- name: validate JSON
30+
run: find dashboards -name "*.json" -type f -exec jsonlint -c {} \;
3131

3232
obs-commit:
3333
needs: build
3434
if: github.ref == 'refs/heads/main'
3535
runs-on: ubuntu-latest
3636
container:
37-
image: ghcr.io/trento-project/continuous-delivery:main
37+
image: ghcr.io/trento-project/continuous-delivery:0.1.0
3838
options: -u 0:0
3939
env:
4040
OBS_USER: ${{ secrets.OBS_USER }}
@@ -44,12 +44,9 @@ jobs:
4444
REPOSITORY: ${{ github.repository }}
4545
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646
steps:
47-
- uses: actions/checkout@v3
48-
with:
49-
fetch-depth: 0
50-
- name: configure OSC
51-
run: |
52-
mkdir -p $HOME/.config/osc
53-
cp /home/osc/.config/osc/oscrc $HOME/.config/osc
54-
/scripts/init_osc_creds.sh
55-
- run: make dashboards-obs-commit
47+
- uses: actions/checkout@v3
48+
with:
49+
fetch-depth: 0
50+
- name: configure OSC
51+
run: /scripts/init_osc_creds.sh
52+
- run: make dashboards-obs-commit

.github/workflows/exporter-ci.yml

Lines changed: 55 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,52 @@ on:
1010
push:
1111
branches: [main]
1212
paths-ignore:
13-
- 'dashboards/**'
14-
- 'packaging/obs/grafana-ha-cluster-dashboards/**'
15-
- '.github/workflows/dashboards*'
13+
- "dashboards/**"
14+
- "packaging/obs/grafana-ha-cluster-dashboards/**"
15+
- ".github/workflows/dashboards*"
1616
pull_request:
1717
paths-ignore:
18-
- 'dashboards/**'
19-
- 'packaging/obs/grafana-ha-cluster-dashboards/**'
20-
- '.github/workflows/dashboards*'
18+
- "dashboards/**"
19+
- "packaging/obs/grafana-ha-cluster-dashboards/**"
20+
- ".github/workflows/dashboards*"
2121
workflow_dispatch:
2222
release:
23-
types: [ published ]
23+
types: [published]
2424

2525
jobs:
2626
build:
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v3
30-
with:
31-
fetch-depth: 0
32-
- uses: actions/setup-go@v3
33-
with:
34-
go-version-file: 'go.mod'
35-
id: go
36-
- name: static analysis
37-
run: make static-checks
38-
- name: test
39-
run: make test
40-
- name: build
41-
run: make -j4 build-all
42-
- name: compress
43-
run: |
44-
set -x
45-
for FILE in build/bin/*; do
46-
gzip $FILE
47-
done
48-
- uses: actions/upload-artifact@v3
49-
with:
50-
name: ha_cluster_exporter
51-
path: build/bin
29+
- uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
- uses: actions/setup-go@v3
33+
with:
34+
go-version-file: "go.mod"
35+
id: go
36+
- name: static analysis
37+
run: make static-checks
38+
- name: test
39+
run: make test
40+
- name: build
41+
run: make -j4 build-all
42+
- name: compress
43+
run: |
44+
set -x
45+
for FILE in build/bin/*; do
46+
gzip $FILE
47+
done
48+
- uses: actions/upload-artifact@v3
49+
with:
50+
name: ha_cluster_exporter
51+
path: build/bin
5252

5353
obs-commit:
5454
needs: build
5555
if: github.ref == 'refs/heads/main'
5656
runs-on: ubuntu-latest
5757
container:
58-
image: ghcr.io/trento-project/continuous-delivery:main
58+
image: ghcr.io/trento-project/continuous-delivery:0.1.0
5959
options: -u 0:0
6060
env:
6161
OBS_USER: ${{ secrets.OBS_USER }}
@@ -65,23 +65,19 @@ jobs:
6565
REPOSITORY: ${{ github.repository }}
6666
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
steps:
68-
- uses: actions/checkout@v3
69-
with:
70-
fetch-depth: 0
71-
- name: configure OSC
72-
run: |
73-
mkdir -p $HOME/.config/osc
74-
cp /home/osc/.config/osc/oscrc $HOME/.config/osc
75-
/scripts/init_osc_creds.sh
76-
- run: git config --global --add safe.directory $(pwd)
77-
- run: make exporter-obs-commit
68+
- uses: actions/checkout@v3
69+
with:
70+
fetch-depth: 0
71+
- name: configure OSC
72+
run: /scripts/init_osc_creds.sh
73+
- run: make exporter-obs-commit
7874

7975
obs-submit-request:
8076
needs: build
8177
if: github.event.release
8278
runs-on: ubuntu-latest
83-
container:
84-
image: ghcr.io/trento-project/continuous-delivery:main
79+
container:
80+
image: ghcr.io/trento-project/continuous-delivery:0.1.0
8581
options: -u 0:0
8682
env:
8783
OBS_USER: ${{ secrets.OBS_USER }}
@@ -93,29 +89,25 @@ jobs:
9389
REPOSITORY: ${{ github.repository }}
9490
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9591
steps:
96-
- uses: actions/checkout@v3
97-
with:
98-
fetch-depth: 0
99-
- name: configure OSC
100-
run: |
101-
mkdir -p $HOME/.config/osc
102-
cp /home/osc/.config/osc/oscrc $HOME/.config/osc
103-
/scripts/init_osc_creds.sh
104-
- run: git config --global --add safe.directory $(pwd)
105-
- run: make exporter-obs-workdir
106-
- run: make exporter-obs-changelog
107-
- run: make exporter-obs-commit
108-
- run: /scripts/submit.sh
92+
- uses: actions/checkout@v3
93+
with:
94+
fetch-depth: 0
95+
- name: configure OSC
96+
run: /scripts/init_osc_creds.sh
97+
- run: make exporter-obs-workdir
98+
- run: make exporter-obs-changelog
99+
- run: make exporter-obs-commit
100+
- run: /scripts/submit.sh
109101

110102
github-release-assets:
111103
needs: build
112104
if: github.event.release
113105
runs-on: ubuntu-latest
114106
steps:
115-
- uses: actions/[email protected]
116-
with:
117-
name: ha_cluster_exporter
118-
- uses: softprops/action-gh-release@v1
119-
with:
120-
files: 'ha_cluster_exporter-*'
121-
token: ${{ secrets.GITHUB_TOKEN }}
107+
- uses: actions/[email protected]
108+
with:
109+
name: ha_cluster_exporter
110+
- uses: softprops/action-gh-release@v1
111+
with:
112+
files: "ha_cluster_exporter-*"
113+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)