-
Notifications
You must be signed in to change notification settings - Fork 20
66 lines (65 loc) · 1.93 KB
/
tests.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
name: Test Core Modules
on:
pull_request:
types:
- "labeled"
workflow_dispatch:
env:
NS8_CORE_MODULES: "core traefik loki ldapproxy"
jobs:
ns8:
if: |
github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'testing'
name: Find NS8 cluster informations
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.modules.outputs.list }}
steps:
- id: tag
run: |
if [ "${{ github.event_name }}" = "pull_request" ]
then
tag=${{ github.head_ref }}
else
tag="${{ github.ref_name }}"
fi
if [ "$tag" = "main" ]
then
tag="latest"
fi
echo "::set-output name=name::${tag}"
- id: modules
run: |
modules_list='[]'
for module in ${NS8_CORE_MODULES}
do
res=$(podman search --limit 150 --list-tags --format json ghcr.io/nethserver/${module} | jq 'any(.[].Tags[]; . == "${{ steps.tag.outputs.name }}")')
if [ "$res" = "true" ]
then
modules_list=$(echo "${modules_list}" | jq -c --arg m ghcr.io/nethserver/${module}:${{ steps.tag.outputs.name }} ' . + [$m]')
fi
done
echo "::set-output name=list::${modules_list}"
run_tests:
needs: ns8
uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@main
with:
setup_cluster: false
path: core/
coremodules: ${{ join(fromJSON(needs.ns8.outputs.modules), ' ' ) }}
secrets:
do_token: ${{ secrets.do_token }}
remove_label:
name: "Cleaup PR label"
runs-on: ubuntu-latest
needs: run_tests
if: |
github.event.label.name == 'testing' &&
needs.infra_destroy.result == 'success' &&
always()
steps:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: testing