Skip to content

Commit

Permalink
Split diagnostics to a separate CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Dec 10, 2023
1 parent 26daae7 commit c68df75
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
if: env.pr_from_main_repo && matrix.run-diagnostics
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Upload historical database & diagnostics
Expand Down

0 comments on commit c68df75

Please sign in to comment.