|
| 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 |
0 commit comments