-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (54 loc) · 1.9 KB
/
test-ci-push.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
name: test-CI-on-push
concurrency:
group: ci-${{ github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
env:
CI_USER: cryostat+bot
CI_REGISTRY: quay.io/cryostat
CI_OPERATOR_IMG: quay.io/cryostat/cryostat-operator
CI_BUNDLE_IMG: quay.io/cryostat/cryostat-operator-bundle
CI_SCORECARD_IMG: quay.io/cryostat/cryostat-operator-scorecard
CI_PLATFORMS: linux/amd64,linux/arm64
OPENSUSE_UNOFFICIAL_LIBCONTAINERS_KEY_URL: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key"
OPENSUSE_UNOFFICIAL_LIBCONTAINERS_SOURCE_URL: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04"
jobs:
check-before-test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.repository_owner == 'cryostatio'
steps:
- name: Fail if needs-triage label applied
if: ${{ contains(github.event.issue.labels.*.name, 'needs-triage') }}
run: exit 1
- name: Fail if safe-to-test label is not applied
if: ${{ !contains(github.event.issue.labels.*.name, 'safe-to-test') }}
run: exit 1
get-test-image-tag:
runs-on: ubuntu-latest
needs: [check-before-test]
outputs:
tag: ${{ steps.compute-tag.outputs.tag }}
steps:
- name: Compute test image tag
id: compute-tag
run: |
prefix="ci"
if [ -n "${{ github.event.number }}" ]; then
prefix="pr-${{ github.event.number }}"
fi
echo "tag=${prefix}-$GITHUB_SHA" >> $GITHUB_OUTPUT
run-test-jobs:
uses: ./.github/workflow/test-ci-reusable.yaml
needs: [get-test-image-tag]
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
tag: ${{ needs.get-test-image-tag.outputs.tag }}