build: update tests workflow

- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.
- Add Go Modules caching using  `actions/setup-go` (supported since
  >=v3).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals 2023-03-21 14:16:03 +01:00
parent 40ab611fc2
commit 85bde48a7e
No known key found for this signature in database
GPG Key ID: 979F380FC2341744
1 changed files with 15 additions and 20 deletions

View File

@ -20,18 +20,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with: with:
go-version: 1.20.x go-version: 1.20.x
- name: Restore Go cache cache-dependency-path: |
uses: actions/cache@v3 **/go.sum
with: **/go.mod
path: /home/runner/work/_temp/_github_home/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests - name: Run tests
env: env:
SKIP_COSIGN_VERIFICATION: true SKIP_COSIGN_VERIFICATION: true
@ -45,11 +41,14 @@ jobs:
runs-on: [self-hosted, Linux, ARM64, equinix] runs-on: [self-hosted, Linux, ARM64, equinix]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with: with:
go-version: 1.20.x go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Run tests - name: Run tests
env: env:
SKIP_COSIGN_VERIFICATION: true SKIP_COSIGN_VERIFICATION: true
@ -76,18 +75,14 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with: with:
go-version: 1.20.x go-version: 1.20.x
- name: Restore Go cache cache-dependency-path: |
uses: actions/cache@v3 **/go.sum
with: **/go.mod
path: /home/runner/work/_temp/_github_home/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install and configure Docker using colima - name: Install and configure Docker using colima
# Ref: https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running # Ref: https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
run: | run: |