From c68df75965b749993cdc9751bdb0ea998365af37 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Sun, 10 Dec 2023 18:23:45 +0100 Subject: [PATCH] Split diagnostics to a separate CI job --- .github/workflows/pytest.yaml | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index ddfa37d..507570d 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -75,28 +75,40 @@ jobs: - name: Upload test coverage to Codecov.io uses: codecov/codecov-action@v3 - # TODO Use https://github.com/marketplace/actions/setup-rclone-action - - name: Install rclone - if: env.pr_from_main_repo && matrix.run-diagnostics + diagnostics: + if: env.pr_from_main_repo + needs: [pytest] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: actions/setup-python@v4 + with: # Should be the same as the latest supported version, above + python-version: "3.12" + cache: pip + cache-dependency-path: "**/pyproject.toml" + + - name: Upgrade pip + run: python -m pip install --upgrade pip + + - name: Install the Python package and its dependencies + run: pip install .[tests] + + - name: Set up Rclone + uses: AnimMouse/setup-rclone@v1 + + - name: Create diagnostics and upload to Google Cloud Storage env: service_account_json: ${{ secrets.GCS_SERVICE_ACCOUNT_1 }} run: | - mkdir -p $HOME/.cache - pushd $HOME/.cache - curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip - popd - unzip $HOME/.cache/rclone-current-linux-amd64.zip - ls -d rclone-v* > $GITHUB_PATH echo "$service_account_json" >ci/service-account-key.json - - - name: Create diagnostics and upload to Google Cloud Storage - if: env.pr_from_main_repo && matrix.run-diagnostics - run: | item historical diagnostics output/ rclone --progress copy output ${{ env.gcs_bucket }}${{ github.run_id }}/ - uses: LouisBrunner/checks-action@v1.1.1 - if: env.pr_from_main_repo && matrix.run-diagnostics with: token: ${{ secrets.GITHUB_TOKEN }} name: Upload historical database & diagnostics