Skip to content

Merge pull request #2 from vitaliil-jfrog/feature/WKS-890 #2

Merge pull request #2 from vitaliil-jfrog/feature/WKS-890

Merge pull request #2 from vitaliil-jfrog/feature/WKS-890 #2

Workflow file for this run

name: Go Tests
on:
push:
branches:
- '**'
tags-ignore:
- '**'
# Triggers the workflow on labeled PRs only.
pull_request_target:
types: [labeled]
# Ensures that only the latest commit is running for each PR at a time.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
cancel-in-progress: true
jobs:
GO-tests:
# Go modules doesn't allow passing credentials to a private registry using an HTTP URL. Therefore, the Go tests run against a remote Artifactory server.
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push'
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Go Cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: go-
- name: Run Go tests
run: |
${GITHUB_WORKSPACE}/.github/scripts/gotest.sh ./...