Skip to content

Commit a3f753b

Browse files
committed
chore: tidy ci.yml
1 parent 3c193d8 commit a3f753b

1 file changed

Lines changed: 45 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ jobs:
3030
- validate-gomod
3131
- validate-shfmt
3232
steps:
33-
- name: Set up Docker Buildx
33+
-
34+
name: Set up Docker Buildx
3435
uses: docker/setup-buildx-action@v3
35-
- name: Run
36+
-
37+
name: Run
3638
uses: docker/bake-action@v6
3739
with:
3840
targets: ${{ matrix.target }}
@@ -45,9 +47,11 @@ jobs:
4547
- build
4648
- cross
4749
steps:
48-
- name: Set up Docker Buildx
50+
-
51+
name: Set up Docker Buildx
4952
uses: docker/setup-buildx-action@v3
50-
- name: Run
53+
-
54+
name: Run
5155
uses: docker/bake-action@v6
5256
with:
5357
targets: ${{ matrix.target }}
@@ -66,16 +70,20 @@ jobs:
6670
env:
6771
GO_VERSION: ${{ matrix.go }}
6872
steps:
69-
- name: Set up Docker Buildx
73+
-
74+
name: Set up Docker Buildx
7075
uses: docker/setup-buildx-action@v3
71-
- name: Test
76+
-
77+
name: Test
7278
uses: docker/bake-action@v6
7379
with:
7480
targets: test-${{ matrix.mode }}
75-
- name: Upload coverage
81+
-
82+
name: Upload coverage
7683
uses: codecov/codecov-action@v5
7784
# skip the step for EarthBuild
7885
if: false
86+
7987
with:
8088
directory: ${{ env.DESTDIR }}/coverage
8189
flags: unit,${{ matrix.mode }},go-${{ matrix.go }}
@@ -96,18 +104,22 @@ jobs:
96104
steps:
97105
-
98106
name: Checkout
99-
uses: actions/checkout@v3
107+
uses: actions/checkout@v4
100108
-
101109
name: Set up Go
102110
uses: actions/setup-go@v5
103111
with:
104112
go-version: ${{ matrix.go }}
105-
- name: Test
113+
-
114+
name: Test
106115
run: |
107116
go test -coverprofile="coverage.txt" -covermode="atomic" ./...
108117
go tool cover -func="coverage.txt"
109-
- name: Upload coverage
110-
if: always()
118+
-
119+
name: Upload coverage
120+
# skip the step for EarthBuild
121+
if: false
122+
111123
uses: codecov/codecov-action@v5
112124
with:
113125
files: ./coverage.txt
@@ -124,9 +136,17 @@ jobs:
124136
env:
125137
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
126138
steps:
139+
-
140+
name: Prepare
141+
run: |
142+
echo "VAGRANT_FILE=hack/Vagrantfile.${{ matrix.os }}" >> $GITHUB_ENV
143+
144+
# Sets semver Go version to be able to download tarball during vagrant setup
145+
goVersion=$(curl --silent "https://go.dev/dl/?mode=json&include=all" | jq -r '.[].files[].version' | uniq | sed -e 's/go//' | sort -V | grep $GO_VERSION | tail -1)
146+
echo "GO_VERSION=$goVersion" >> $GITHUB_ENV
127147
-
128148
name: Checkout
129-
uses: actions/checkout@v3
149+
uses: actions/checkout@v4
130150
-
131151
name: Cache Vagrant boxes
132152
uses: actions/cache@v4
@@ -135,7 +155,8 @@ jobs:
135155
key: ${{ runner.os }}-vagrant-${{ matrix.os }}-${{ hashFiles(env.VAGRANT_FILE) }}
136156
restore-keys: |
137157
${{ runner.os }}-vagrant-${{ matrix.os }}-
138-
- name: Install vagrant
158+
-
159+
name: Install vagrant
139160
run: |
140161
set -x
141162
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
@@ -146,22 +167,27 @@ jobs:
146167
sudo chmod a+rw /var/run/libvirt/libvirt-sock
147168
vagrant plugin install vagrant-libvirt
148169
vagrant --version
149-
- name: Set up vagrant
170+
-
171+
name: Set up vagrant
150172
run: |
151173
ln -sf ${{ env.VAGRANT_FILE }} Vagrantfile
152174
vagrant up --no-tty
153-
- name: Test
154-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
175+
-
176+
name: Test
177+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
155178
with:
156179
timeout_minutes: 20
157180
max_attempts: 5
158181
command: |
159182
vagrant ssh -- "cd /vagrant; go test -buildvcs=false -coverprofile=coverage.txt -covermode=atomic ./..."
160183
vagrant ssh -c "sudo cat /vagrant/coverage.txt" > coverage.txt
161-
- name: Upload coverage
162-
if: always()
184+
-
185+
name: Upload coverage
186+
# skip the step for EarthBuild
187+
if: false
188+
163189
uses: codecov/codecov-action@v5
164190
with:
165191
files: ./coverage.txt
166192
flags: unit,${{ matrix.os }}
167-
token: ${{ secrets.CODECOV_TOKEN }}
193+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)