| # A CI workflow to run tests on a daily cron job. | |
| name: Daily Testing | |
| on: | |
| schedule: | |
| - cron: "00 14 * * *" # Everyday at 3:00 PM UTC (8:00 AM PST) | |
| permissions: | |
| contents: read | |
| jobs: | |
| daily_testing: | |
| name: Daily Testing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Dart SDK | |
| uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c | |
| with: | |
| sdk: main | |
| - id: checkout | |
| name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - id: dwds_webdev_integration_test_pub_upgrade | |
| name: dwds_webdev_integration_test; dart pub upgrade | |
| run: dart pub upgrade | |
| if: "always() && steps.checkout.conclusion == 'success'" | |
| working-directory: dwds_webdev_integration_test | |
| - name: dwds_webdev_integration_test; dart analyze . | |
| run: dart analyze . | |
| if: "always() && steps.dwds_webdev_integration_test_pub_upgrade.conclusion == 'success'" | |
| working-directory: dwds_webdev_integration_test | |
| - id: dwds_webdev_integration_test_daily_tests | |
| name: "dwds_webdev_integration_test; dart test --tags=daily" | |
| run: "dart test --tags=daily" | |
| if: "always() && steps.dwds_webdev_integration_test_pub_upgrade.conclusion == 'success'" | |
| working-directory: dwds_webdev_integration_test | |
| - id: webdev_pub_upgrade | |
| name: webdev; dart pub upgrade | |
| run: dart pub upgrade | |
| if: "always() && steps.checkout.conclusion == 'success'" | |
| working-directory: webdev | |
| - name: webdev; dart analyze . | |
| run: dart analyze . | |
| if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" | |
| working-directory: webdev | |
| - id: webdev_daily_tests | |
| name: "webdev; dart test --tags=daily" | |
| run: "dart test --tags=daily" | |
| if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" | |
| working-directory: webdev | |
| - name: "Notify failure" | |
| if: "always() && (steps.dwds_webdev_integration_test_daily_tests.conclusion == 'failure' || steps.webdev_daily_tests.conclusion == 'failure')" | |
| run: | | |
| curl -H "Content-Type: application/json" -X POST -d \ | |
| "{'text':'Daily Webdev tests failed! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'}" \ | |
| "${{ secrets.WEBDEV_NOTIFICATION_CHAT_WEBHOOK }}" |