-
Notifications
You must be signed in to change notification settings - Fork 8
88 lines (83 loc) · 2.72 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: test
# secrets aren't inherited to tasks, so not able to use the reusable as of 2023-02.
# Using workflow directly and will revisit in the future.
# uses: delineaxpm/github-workflows/.github/workflows/test.yml@main
# secrets: inherit
env:
DSV_K8S_TEST_CONFIG: ${{ secrets.DSV_TMG_CONFIG }}
DSV_K8S_TEST_SECRET_PATH: ci:tests:dsv-k8s:sync-test
on:
pull_request:
push:
tags:
- v*
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: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: aquaproj/aqua-installer@61e2563dfe7674cbf74fe6ec212e444198a3bb00 # v2.0.2
with:
aqua_version: v1.38.0
enable_aqua_install: true
aqua_opts: '--tags test'
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@v3
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@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # renovate: tag=v3.1.1
with:
fail_ci_if_error: false