Skip to content

Commit 4403424

Browse files
Merge pull request #787 from juanmanuel-tirado/JUJU-2485_add_nightly_build_check
[JUJU-2485] Added nightly built checks.
2 parents bd06a24 + 563b200 commit 4403424

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Nightly release candidate testing 2.9
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Run at 12AM UTC, every day
6+
7+
jobs:
8+
candidate-integration:
9+
name: Edge integration
10+
timeout-minutes: 120
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python:
15+
- "3.8"
16+
- "3.9"
17+
- "3.10"
18+
steps:
19+
- name: Download artifact from previous workflow
20+
id: download_artifact
21+
uses: dawidd6/action-download-artifact@v2
22+
with:
23+
workflow_conclusion: success
24+
name: juju-last-candidate-version
25+
if_no_artifact_found: ignore
26+
- name: Check if there is a new candidate
27+
shell: bash
28+
run: |
29+
candidate=$(snap info juju | grep 2.9/candidate | awk '{print $2}')
30+
last_tested=NA
31+
if [ -f juju-last-candidate-version ]; then
32+
last_tested=$(cat juju-last-candidate-version)
33+
fi
34+
echo "Last tested was $last_tested"
35+
echo "Latest juju version found is $candidate"
36+
next_test=NA
37+
if [[ "$candidate" == "^" ]]; then
38+
echo "No candidate to test"
39+
else
40+
if [[ "$candidate" == "$last_tested" ]]; then
41+
echo "Candidate $candidate was already tested"
42+
else
43+
echo "Candidate $candidate has to be tested"
44+
next_test="$candidate"
45+
fi
46+
fi
47+
echo "next-test=$next_test" >> $GITHUB_ENV
48+
echo "$next_test" > ~/juju-last-candidate-version
49+
- name: Check out code
50+
uses: actions/checkout@v3
51+
if: ${{ env.next-test != 'NA' }}
52+
- name: Setup operator environment
53+
if: ${{ env.next-test != 'NA' }}
54+
uses: charmed-kubernetes/actions-operator@main
55+
with:
56+
provider: lxd
57+
juju-channel: 2.9/candidate
58+
- name: Setup Python
59+
if: ${{ env.next-test != 'NA' }}
60+
uses: actions/setup-python@v4
61+
with:
62+
python-version: ${{ matrix.python }}
63+
- name: Install dependencies
64+
if: ${{ env.next-test != 'NA' }}
65+
run: pip install tox
66+
- name: Run integration
67+
if: ${{ env.next-test != 'NA' }}
68+
# Force one single concurrent test
69+
run: tox -e integration -- -n 1
70+
- name: Upload artifact
71+
if: ${{ env.next-test != 'NA' }}
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: juju-last-candidate-version
75+
path: ~/juju-last-candidate-version
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Nightly release edge testing 2.9
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Run at 12AM UTC, every day
6+
7+
jobs:
8+
candidate-integration:
9+
name: Edge integration
10+
timeout-minutes: 120
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python:
15+
- "3.8"
16+
- "3.9"
17+
- "3.10"
18+
steps:
19+
- name: Download artifact from previous workflow
20+
id: download_artifact
21+
uses: dawidd6/action-download-artifact@v2
22+
with:
23+
workflow_conclusion: success
24+
name: juju-last-edge-version
25+
if_no_artifact_found: ignore
26+
- name: Check if there is a new candidate
27+
shell: bash
28+
run: |
29+
edge=$(snap info juju | grep 2.9/edge | awk '{print $2}')
30+
last_tested=NA
31+
if [ -f juju-last-edge-version ]; then
32+
last_tested=$(cat juju-last-edge-version)
33+
fi
34+
echo "Last tested was $last_tested"
35+
echo "Latest juju version found is $edge"
36+
next_test=NA
37+
if [[ "$edge" == "^" ]]; then
38+
echo "No edge to test"
39+
else
40+
if [[ "$edge" == "$last_tested" ]]; then
41+
echo "Edge $edge was already tested"
42+
else
43+
echo "Edge $edge has to be tested"
44+
next_test="$edge"
45+
fi
46+
fi
47+
echo "next-test=$next_test" >> $GITHUB_ENV
48+
echo "$next_test" > ~/juju-last-edge-version
49+
- name: Check out code
50+
uses: actions/checkout@v3
51+
if: ${{ env.next-test != 'NA' }}
52+
- name: Setup operator environment
53+
if: ${{ env.next-test != 'NA' }}
54+
uses: charmed-kubernetes/actions-operator@main
55+
with:
56+
provider: lxd
57+
juju-channel: 2.9/edge
58+
- name: Setup Python
59+
if: ${{ env.next-test != 'NA' }}
60+
uses: actions/setup-python@v4
61+
with:
62+
python-version: ${{ matrix.python }}
63+
- name: Install dependencies
64+
if: ${{ env.next-test != 'NA' }}
65+
run: pip install tox
66+
- name: Run integration
67+
if: ${{ env.next-test != 'NA' }}
68+
# Force one single concurrent test
69+
run: tox -e integration -- -n 1
70+
- name: Upload artifact
71+
if: ${{ env.next-test != 'NA' }}
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: juju-last-edge-version
75+
path: ~/juju-last-edge-version

0 commit comments

Comments
 (0)