-
Notifications
You must be signed in to change notification settings - Fork 102
75 lines (73 loc) · 2.42 KB
/
test_candidate.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
name: Nightly release candidate testing
on:
schedule:
- cron: "0 0 * * *" # Run at 12AM UTC, every day
jobs:
candidate-integration:
name: Edge integration
timeout-minutes: 150
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Download artifact from previous workflow
id: download_artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow_conclusion: success
name: juju-last-candidate-version
if_no_artifact_found: ignore
- name: Check if there is a new candidate
shell: bash
run: |
candidate=$(snap info juju | grep 3.1/candidate | awk '{print $2}')
last_tested=NA
if [ -f juju-last-candidate-version ]; then
last_tested=$(cat juju-last-candidate-version)
fi
echo "Last tested was $last_tested"
echo "Latest juju version found is $candidate"
next_test=NA
if [[ "$candidate" == "^" ]]; then
echo "No candidate to test"
else
if [[ "$candidate" == "$last_tested" ]]; then
echo "Candidate $candidate was already tested"
else
echo "Candidate $candidate has to be tested"
next_test="$candidate"
fi
fi
echo "next-test=$next_test" >> $GITHUB_ENV
echo "$next_test" > ~/juju-last-candidate-version
- name: Check out code
uses: actions/checkout@v3
if: ${{ env.next-test != 'NA' }}
- name: Setup operator environment
if: ${{ env.next-test != 'NA' }}
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.2/candidate
- name: Setup Python
if: ${{ env.next-test != 'NA' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
if: ${{ env.next-test != 'NA' }}
run: pip install tox
- name: Run integration
if: ${{ env.next-test != 'NA' }}
# Force one single concurrent test
run: tox -e integration -- -n 1
- name: Upload artifact
if: ${{ env.next-test != 'NA' }}
uses: actions/upload-artifact@v3
with:
name: juju-last-candidate-version
path: ~/juju-last-candidate-version