Skip to content

Bump actions/setup-go from 4 to 5 (#74) #216

Bump actions/setup-go from 4 to 5 (#74)

Bump actions/setup-go from 4 to 5 (#74) #216

Workflow file for this run

name: test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
GO_LATEST_VERSION: "1.20.x"
jobs:
test-macos:
strategy:
fail-fast: false
matrix:
go-version: [ 1.20.x ]
runs-on: macos-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Go cache
uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-cache-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-cache
- name: Test
id: test
run: |
make test
- name: Upload code coverage (unit)
if: matrix.go-version == env.GO_LATEST_VERSION
uses: codecov/codecov-action@v3
with:
files: ./unit.coverprofile
flags: unittests-${{ runner.os }}
- name: Upload code coverage (features)
if: matrix.go-version == env.GO_LATEST_VERSION
uses: codecov/codecov-action@v3
with:
files: ./features.coverprofile
flags: featurestests-${{ runner.os }}
test-linux:
strategy:
fail-fast: false
matrix:
go-version: [ 1.20.x ]
runs-on: ubuntu-latest
container:
image: nhatthm/ubuntu-keyring:20.04
options: --privileged
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Go cache
uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-cache-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-cache
- name: Test
id: test
run: |
mkdir -p /github/home/.cache/
mkdir -p /github/home/.local/share/keyrings/
chmod 700 -R /github/home/.local/
echo 'somecredstorepass' | gnome-keyring-daemon --unlock
make test
shell: dbus-run-session -- bash --noprofile --norc -eo pipefail {0}
- name: Upload code coverage (unit)
if: matrix.go-version == env.GO_LATEST_VERSION
uses: codecov/codecov-action@v3
with:
files: ./unit.coverprofile
flags: unittests-${{ runner.os }}
- name: Upload code coverage (features)
if: matrix.go-version == env.GO_LATEST_VERSION
uses: codecov/codecov-action@v3
with:
files: ./features.coverprofile
flags: featurestests-${{ runner.os }}