Skip to content

Utility method rename #542

Utility method rename

Utility method rename #542

Workflow file for this run

name: test
on:
workflow_call:
push:
tags:
- "*"
branches:
- main
- master
pull_request:
branches:
- main
- master
permissions:
contents: write
jobs:
build:
runs-on: "ubuntu-latest"
# $PF_SECTION_START(setup)$
# $PF_SECTION_END(setup)$
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 0
- name: "Golang"
uses: "actions/setup-go@v2"
with:
go-version: "1.23.0"
- name: "Cache"
uses: "actions/cache@v2"
with:
path: "~/go/pkg/mod"
key: "${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}"
restore-keys: |
${{ runner.os }}-go-
- name: "Dependencies"
run: "bin/bootstrap.sh"
- name: "Config"
env:
OWNER: "${{ github.repository_owner }}"
TOKEN: "${{ secrets.CR_PAT }}"
run: "git config --global url.\"https://${OWNER}:${TOKEN}@github.com\".insteadOf \"https://github.com\""
- name: "Templates"
run: "bin/templates.sh"
- name: "Modules"
run: "go mod download"
env:
GOPRIVATE: "github.com/${{ github.repository_owner }}"
GITHUB_TOKEN: "${{ secrets.CR_PAT }}"
OWNER: "${{ github.repository_owner }}"
TOKEN: "${{ secrets.CR_PAT }}"
- name: "Test"
run: |
if [ -f "test.env" ]; then
export $(cat test.env | grep -v "#" | xargs)
fi
if [ -f "./bin/test-setup.sh" ]; then
./bin/test-setup.sh
fi
go test -race -json ./app/... > test.json
env:
GOPRIVATE: "github.com/${{ github.repository_owner }}"
GITHUB_TOKEN: "${{ secrets.CR_PAT }}"
OWNER: "${{ github.repository_owner }}"
TOKEN: "${{ secrets.CR_PAT }}"
- name: "Annotate"
if: always()
uses: guyarb/[email protected]
with:
test-results: test.json