|
| 1 | +# A CI workflow to run stable tests on a daily cron job. |
| 2 | + |
| 3 | +name: Daily Stable Testing |
| 4 | + |
| 5 | +on: |
| 6 | + schedule: |
| 7 | + - cron: "00 14 * * *" # Everyday at 3:00 PM UTC (8:00 AM PST) |
| 8 | + |
| 9 | +env: |
| 10 | + PUB_ENVIRONMENT: bot.github |
| 11 | + DISPLAY: ":99" |
| 12 | + |
| 13 | +# TODO(elliette): Consider parsing the Webdev pubspec to find the pinned DWDS |
| 14 | +# version, and running tests against DWDS as well. |
| 15 | +jobs: |
| 16 | + testing_stable: |
| 17 | + name: Testing Dart Stable SDK |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Set up stable Dart SDK |
| 21 | + uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 |
| 22 | + with: |
| 23 | + sdk: stable |
| 24 | + - name: Activate Webdev |
| 25 | + run: dart pub global activate webdev |
| 26 | + - name: Get Webdev version tag |
| 27 | + id: version |
| 28 | + run: | |
| 29 | + echo "VERSION_TAG=$(webdev --version)" >> $GITHUB_OUTPUT |
| 30 | + - name: Checkout Webdev at version tag |
| 31 | + id: checkout |
| 32 | + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac |
| 33 | + with: |
| 34 | + ref: webdev-v${{ steps.version.outputs.VERSION_TAG }} |
| 35 | + - name: Upgrade deps |
| 36 | + id: webdev_pub_upgrade |
| 37 | + run: dart pub upgrade |
| 38 | + working-directory: webdev |
| 39 | + # Note: xvfb is required to run Chrome headless tests on Linux. |
| 40 | + - name: Set up X virtual frame buffer |
| 41 | + run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & |
| 42 | + working-directory: webdev |
| 43 | + - name: Run stable tests |
| 44 | + id: webdev_stable_tests |
| 45 | + run: dart test -j 1 |
| 46 | + if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" |
| 47 | + working-directory: webdev |
| 48 | + - name: "Notify failure" |
| 49 | + # TODO(elliette): Uncomment after determining that notifications are working. |
| 50 | + # if: "always() && steps.webdev_stable_tests.conclusion == 'failure'" |
| 51 | + run: | |
| 52 | + curl -H "Content-Type: application/json" -X POST -d \ |
| 53 | + "{'text':'Daily stable tests failed! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'}" \ |
| 54 | + "${{ secrets.WEBDEV_NOTIFICATION_CHAT_WEBHOOK }}" |
0 commit comments