Skip to content

build(aqua-proj): 🌊 minor aqua #529

build(aqua-proj): 🌊 minor aqua

build(aqua-proj): 🌊 minor aqua #529

Workflow file for this run

---
name: test
on:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
gotestflags:
type: string
description: 'GOTEST_FLAGS to pass'
required: false
default: '--tags=integration'
workflow_call:
inputs:
gotestflags:
type: string
description: 'GOTEST_FLAGS to pass'
required: false
default: '--tags=integration'
defaults:
run:
shell: bash
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.action }}
cancel-in-progress: false
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: set-aqua-policy-if-file-exists
run: |
if [[ -f aqua-policy.yaml ]]; then
echo "AQUA_POLICY_CONFIG=${GITHUB_WORKSPACE}/aqua-policy.yaml:${AQUA_POLICY_CONFIG}" >> $GITHUB_ENV
elif [[ -f .aqua/aqua-policy.yaml ]]; then
echo "AQUA_POLICY_CONFIG=${GITHUB_WORKSPACE}/.aqua/aqua-policy.yaml:${AQUA_POLICY_CONFIG}" >> $GITHUB_ENV
else
echo "👉 No aqua-policy.yaml or .aqua/aqua-policy.yaml file found, skipping setting AQUA_POLICY_CONFIG"
fi
- uses: aquaproj/aqua-installer@11dd79b4e498d471a9385aa9fb7f62bb5f52a73c # v4.0.4
with:
aqua_version: v2.57.1
enable_aqua_install: true
aqua_opts: '--tags test'
policy_allow: true
env:
AQUA_LOG_LEVEL: debug
AQUA_OPTS: ''
- name: env-config-go
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
# no pinning of github managed action
- name: Setup Golang caches
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
${HOME}/.cache/go-build
${HOME}/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
# - name: mage-init
# run: |
# export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin/aqua:${PATH}"
# export PATH="$(go env GOPATH)/bin:${PATH}"
# mage init
- name: mage-testsum
run: |
export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin/aqua:${PATH}"
export PATH="$(go env GOPATH)/bin:${PATH}"
USER_GOTESTFLAGS="${{ github.event.inputs.name }}"
# Use user input or fall back to --tags=integration if nothing provided
GOTEST_FLAGS=${USER_GOTESTFLAGS:-"--tags=integration"}
mage go:testsum ./...
env:
# Race conditions will be hit due to the cli driven tasks and binaries being called.
GOTEST_DISABLE_RACE: 1
# GOTEST_FLAGS: '${{ inputs.gotestflags }}'
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}