Skip to content

Improve output

Improve output #4

Workflow file for this run

name: Go Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.20.x
- 1.21.x
- 1.22.x
- 1.23.x
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Cache modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
${{ runner.os }}-go-
${{ runner.os }}-
- name: Install dependencies
run: go mod download
- name: Set CLOUDINARY_URL
run: |
export CLOUDINARY_URL=$(bash scripts/get_test_cloud.sh)
echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV
echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)"
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run tests
run: |
gotestsum --junitfile unit-tests.xml --format pkgname ./...
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "unit-tests.xml"
if: always()