forked from primaza/primazactl
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.21 KB
/
pr-checks.yaml
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
name: Primazactl pr checks
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main ]
repository_dispatch:
types: [primazactl-test]
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
jobs:
build:
name: Build artifacts
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "^1.20"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: "x64"
- name: Checkout repo
uses: actions/checkout@v3
- name: Lint python
run: make lint
- name: Set Version and Images
id: sets-version
run: |
# set version based on job type
if [[ "${{github.event_name}}" == "repository_dispatch" ]]; then
primaza_version=${{ github.event.client_payload.version }}
echo "GIT_ORG=${{ github.event.client_payload.organization }}" >> $GITHUB_ENV
echo "RUN_FROM=release" >> $GITHUB_ENV
echo "VERSION=$primaza_version" >> $GITHUB_ENV
else
echo "RUN_FROM=config" >> $GITHUB_ENV
echo "VERSION=latest" >> $GITHUB_ENV
fi
- name: run dry-run
run: make test-dry-run
- name: run test
run: make test-local-no-setup
- name: run test with users
env:
CLEAN: clusters
run: make test-users
- name: run test with output
env:
CLEAN: clusters
run: make test-output
- name: run apply command
env:
CLEAN: clusters
run: make test-apply
- name: run test version
if: ${{ env.RUN_FROM == 'config' }}
env:
CLEAN: all
VERSION: v0.1.0
run: make test-version
- name: trigger release
if: ${{ github.event_name == 'repository_dispatch' }}
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.BOT_TOKEN }}
repository: mmulholla/primazactl
event-type: primazactl-release
client-payload: '{"version": "${{ env.VERSION }}",
"organization": "${{ env.GIT_ORG }}"}'