Repository navigation
64 lines (60 loc) · 1.98 KB
/
Copy pathexamples.yml
File metadata and controls
64 lines (60 loc) · 1.98 KB
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
name: Examples
# Community fork: the examples run is slow and creates billable resources; run manually only.
on:
workflow_dispatch:
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout head
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: Install mdtest and upctl
run: |
go install github.com/UpCloudLtd/mdtest@latest
make build
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Install kubectl
uses: azure/setup-kubectl@829323503d1be3d00ca8346e5391ca0b07a9ab0d
with:
version: 'latest'
- name: Test examples
env:
UPCLOUD_TOKEN: ${{ secrets.UPCLOUD_TOKEN }}
run: |
upctl version
upctl account show > /dev/null # Ensure that credentials are valid
mdtest --timeout 45m --junit-xml examples.output.xml examples/
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
with:
name: junit-report
path: examples.output.xml
retention-days: 7
cleanup:
name: Cleanup
runs-on: ubuntu-latest
needs: test
if: ${{ always() }}
steps:
- name: Install upctl
uses: UpCloudLtd/upcloud-cli-action@7e373972e386da6ef8c8336be8a855bafeafcbc8 # v1.0.2
with:
token: ${{ secrets.UPCLOUD_TOKEN }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Purge resources
timeout-minutes: 5
run: upctl all purge --include example-upctl-*
- name: List remaining resources
run: upctl all list --include example-upctl-*
if: ${{ failure() }}