-
Notifications
You must be signed in to change notification settings - Fork 41
64 lines (63 loc) · 2.35 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
# SPDX-FileCopyrightText: Copyright 2023 The Minder Authors
# SPDX-License-Identifier: Apache-2.0
on:
workflow_call:
workflow_dispatch:
jobs:
test:
name: Unit testing
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: 'go.mod'
- name: Set up helm (test dependency)
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@8b4478c7019be847373babde9300210e7de34bfb # v2.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
# copy config file into place
- name: Copy config file
run: cp config/server-config.yaml.example ./server-config.yaml
- name: Launch Registry
run: |
if [ "$(docker inspect -f '{{.State.Running}}' registry 2>/dev/null || true)" != 'true' ]; then
docker run -d --restart=always -p "127.0.0.1:5000:5000" --network bridge --name registry \
registry:2
fi
- name: Fetch go mod dependencies
run: go mod download
# Run the tests
- name: Run tests
env:
MINDER_TEST_REGISTRY: "localhost:5000"
run: make test-cover-silent
- name: Try converting to LCOV
run: go run github.com/jandelgado/gcov2lcov@latest -infile=./coverage.out -outfile=./coverage.lcov
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
authz:
name: Authz tests
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: 'go.mod'
- name: Run `make bootstrap`
run: |
make bootstrap
- name: Run authz tests
run: |-
make authz-tests