Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 57 additions & 27 deletions .github/workflows/test-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,82 @@ on:
# Run 2h after the daily tests.yaml
- cron: "0 8,20 * * *"
workflow_dispatch:
pull_request:
types: [labeled, opened, reopened, synchronize]

jobs:
test-report:
name: Test Report
# Do not run the report job on forks
if: github.repository == 'dask/distributed' || github.event_name == 'workflow_dispatch'
generate:
name: Generate report
# Do not run the report job on forks.
# On PRs, run only if the `test-report` label is set.
if: >
(github.event_name == 'pull_request'
&& contains(github.event.pull_request.labels.*.name, 'test-report'))
|| (github.event_name != 'pull_request'
&& (github.repository == 'dask/distributed' || github.event_name == 'workflow_dispatch'))
runs-on: ubuntu-latest
permissions:
# Read the artifacts of the tests.yaml runs
actions: read
env:
GITHUB_TOKEN: ${{ github.token }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v7.0.0

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v4.0.1
- uses: prefix-dev/setup-pixi@v0.10.0
with:
miniforge-version: latest
condarc-file: continuous_integration/condarc
environment-file: continuous_integration/scripts/test-report-environment.yml
activate-environment: dask-distributed

- name: Show conda options
run: conda config --show

- name: conda list
run: conda list
pixi-version: v0.72.0
environments: test-report
cache: true
locked: true

- uses: actions/cache@v6
id: cache
with:
# Suffix is depending on the backend / OS. Let's be agnostic here
# See https://docs.python.org/3/library/shelve.html#shelve.open
path: |
test_report*
!test_report.html
key: ${{ hashFiles('continuous_integration/scripts/test_report*') }}
# Local databases of downloaded test results, created by test_report.py
path: test_report*.db
# Caches are immutable; use a fresh key to upload an updated database at
# the end of every run, and restore from the most recent one.
key: test-report-${{ hashFiles('continuous_integration/scripts/test_report.py') }}-${{ github.run_id }}
restore-keys: test-report-${{ hashFiles('continuous_integration/scripts/test_report.py') }}-

- name: Generate report
run: |
python continuous_integration/scripts/test_report.py --max-days 90 --max-runs 30 --nfails 1 -o test_report.html
python continuous_integration/scripts/test_report.py --max-days 7 --max-runs 30 --nfails 2 -o test_short_report.html --title "Test Short Report"
pixi run test-report dask/distributed
mkdir deploy
mv test_report.html test_short_report.html deploy/

- name: Upload report as workflow artifact
# Downloaded by the deploy job; also for debugging purposes
uses: actions/upload-artifact@v7
with:
name: test-report
path: deploy

- name: Upload databases as workflow artifact
# For debugging purposes
uses: actions/upload-artifact@v7
with:
name: test-report-db
path: test_report*.db

deploy:
name: Deploy report
needs: generate
# Never update GitHub Pages from PRs
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
# Push to the gh-pages branch
contents: write
steps:
- uses: actions/checkout@v7.0.0

- uses: actions/download-artifact@v8
with:
name: test-report
path: deploy

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
Expand Down
12 changes: 0 additions & 12 deletions continuous_integration/scripts/test-report-environment.yml

This file was deleted.

Loading
Loading