Skip to content

Commit a32f1c4

Browse files
authored
Do not run CI for all Go versions and use caching (#606)
1 parent f5cf712 commit a32f1c4

File tree

4 files changed

+34
-50
lines changed

4 files changed

+34
-50
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
4242
with:
4343
go-version-file: 'go.mod'
44-
cache: false
44+
cache: true
4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
4747
uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99

.github/workflows/examples.yml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,94 +16,86 @@
1616
# SPDX-License-Identifier: Apache-2.0
1717
on:
1818
workflow_call:
19-
name: Examples # not exactly right to test functionality in such a way but it does act as a set of end to end test cases for the time being, nevertheless should be updated
19+
# Not exactly right to test functionality in such a way, but it does act as a set of end-to-end test cases for the time
20+
# being, nevertheless should be updated
21+
name: Examples
2022
jobs:
21-
get-go-versions:
22-
name: Collect available Go versions
23-
runs-on: ubuntu-latest
24-
outputs:
25-
matrix: ${{ steps.versions.outputs.matrix }}
26-
steps:
27-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
28-
- uses: arnested/go-version-action@b556f8d91b644164318c709d28b9083eaf0c064d
29-
id: versions
3023
client:
3124
strategy:
3225
fail-fast: false # Keep running if one leg fails.
3326
matrix:
3427
os: [ubuntu-latest, macos-latest, windows-latest]
35-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
3628
runs-on: ${{ matrix.os }}
37-
needs: get-go-versions
3829
steps:
3930
- name: Checkout code
4031
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
41-
- name: Setup - Go ${{ matrix.go-version }}
32+
- name: Setup - Go
4233
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
4334
with:
44-
go-version: ${{ matrix.go-version }}
35+
go-version-file: 'go.mod'
36+
cache: true
4537
- run: make example-client
38+
4639
repository:
4740
strategy:
4841
fail-fast: false # Keep running if one leg fails.
4942
matrix:
5043
os: [ubuntu-latest, macos-latest, windows-latest]
51-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
5244
runs-on: ${{ matrix.os }}
53-
needs: get-go-versions
5445
steps:
5546
- name: Checkout code
5647
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
57-
- name: Setup - Go ${{ matrix.go-version }}
48+
- name: Setup - Go
5849
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
5950
with:
60-
go-version: ${{ matrix.go-version }}
51+
go-version-file: 'go.mod'
52+
cache: true
6153
- run: make example-repository
54+
6255
multirepo:
6356
strategy:
6457
fail-fast: false # Keep running if one leg fails.
6558
matrix:
6659
os: [ubuntu-latest, macos-latest, windows-latest]
67-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
6860
runs-on: ${{ matrix.os }}
69-
needs: get-go-versions
7061
steps:
7162
- name: Checkout code
7263
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
73-
- name: Setup - Go ${{ matrix.go-version }}
64+
- name: Setup - Go
7465
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
7566
with:
76-
go-version: ${{ matrix.go-version }}
67+
go-version-file: 'go.mod'
68+
cache: true
7769
- run: make example-multirepo
70+
7871
tuf-client-cli:
7972
strategy:
8073
fail-fast: false # Keep running if one leg fails.
8174
matrix:
8275
os: [ubuntu-latest, macos-latest, windows-latest]
83-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
8476
runs-on: ${{ matrix.os }}
85-
needs: get-go-versions
8677
steps:
8778
- name: Checkout code
8879
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
89-
- name: Setup - Go ${{ matrix.go-version }}
80+
- name: Setup - Go
9081
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
9182
with:
92-
go-version: ${{ matrix.go-version }}
83+
go-version-file: 'go.mod'
84+
cache: true
9385
- run: make example-tuf-client-cli
86+
9487
root-signing:
9588
strategy:
9689
fail-fast: false # Keep running if one leg fails.
9790
matrix:
9891
os: [ubuntu-latest, macos-latest, windows-latest]
99-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
10092
runs-on: ${{ matrix.os }}
101-
needs: get-go-versions
10293
steps:
10394
- name: Checkout code
10495
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
105-
- name: Setup - Go ${{ matrix.go-version }}
96+
- name: Setup - Go
10697
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
10798
with:
108-
go-version: ${{ matrix.go-version }}
99+
go-version-file: 'go.mod'
100+
cache: true
109101
- run: make example-root-signing

.github/workflows/linting.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ jobs:
3131
name: golangci-lint
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
35-
- uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
34+
- name: Checkout code
35+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
36+
37+
- name: Setup - Go
38+
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
3639
with:
3740
go-version-file: 'go.mod'
38-
cache: false
39-
- name: golangci-lint
41+
cache: true
42+
43+
- name: Run golangci-lint
4044
uses: golangci/golangci-lint-action@v3
4145
with:
4246
# Require: The version of golangci-lint to use.

.github/workflows/tests.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,28 @@ on:
1818
workflow_call:
1919
name: Tests
2020
jobs:
21-
get-go-versions:
22-
name: Collect available Go versions
23-
runs-on: ubuntu-latest
24-
outputs:
25-
matrix: ${{ steps.versions.outputs.matrix }}
26-
steps:
27-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
28-
- uses: arnested/go-version-action@b556f8d91b644164318c709d28b9083eaf0c064d
29-
id: versions
3021
run:
3122
name: Run
3223
strategy:
3324
fail-fast: false # Keep running if one leg fails.
3425
matrix:
3526
os: [ubuntu-latest, macos-latest, windows-latest]
36-
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
3727
runs-on: ${{ matrix.os }}
38-
needs: get-go-versions
3928
steps:
4029
- name: Set git to use LF
4130
run: git config --global core.autocrlf false
4231

4332
- name: Checkout code
4433
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
4534

46-
- name: Setup - Go ${{ matrix.go-version }}
35+
- name: Setup - Go
4736
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
4837
with:
49-
go-version: ${{ matrix.go-version }}
38+
go-version-file: 'go.mod'
39+
cache: true
5040

5141
- name: Run tests
5242
run: go test -race -covermode=atomic -coverpkg=./metadata/... -coverprofile=coverage.out ./...
5343

5444
- name: Send coverage
5545
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
56-
with:
57-
flags: Go-${{ matrix.go-version }}

0 commit comments

Comments
 (0)