Skip to content

Switch to GitHub Actions #1

Switch to GitHub Actions

Switch to GitHub Actions #1

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: Run tests
run: go test -v ./...