From 87a07083bfd18ed35cdaf5791da44e91f5beff77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 26 Mar 2024 20:16:57 +0100 Subject: [PATCH] CI: add dry run workflow --- .github/workflows/ci.yml | 7 ++++++- .github/workflows/dry_run.yml | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dry_run.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b48a669..45c2b39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: CI -on: [push, pull_request] +on: [ push, pull_request ] jobs: ci: @@ -26,6 +26,11 @@ jobs: - name: Run tests run: cargo test + - name: Dry run + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_API_READ_TOKEN }} + run: cargo run -- --only-print-plan github + - name: Build the Docker container run: docker build -t sync-team . diff --git a/.github/workflows/dry_run.yml b/.github/workflows/dry_run.yml new file mode 100644 index 0000000..357609d --- /dev/null +++ b/.github/workflows/dry_run.yml @@ -0,0 +1,24 @@ +# Smoke test that checks if we can download team data and read from the GitHub API. +name: Dry run + +on: + workflow_dispatch: + schedule: + # Try to dry run every 4 hours + - cron: "0 */4 * * *" + +jobs: + run: + name: Perform a dry run + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - uses: Swatinem/rust-cache@v1 + - name: Dry run + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_API_READ_TOKEN }} + run: cargo run -- --only-print-plan github