From 3257ea97d2420969be840ca04fd200a7e1d4374f Mon Sep 17 00:00:00 2001 From: Mridul Seth Date: Thu, 21 May 2026 16:47:40 +0200 Subject: [PATCH 1/2] [CI] Publish nightly reduced data files --- .github/workflows/nightly.yml | 54 ++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4bdce9fac..7eb424162 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,6 +1,7 @@ name: Nightly Tests on: + pull_request: workflow_dispatch: schedule: - cron: "30 1 * * 1-5" @@ -23,6 +24,16 @@ jobs: - essreflectometry - esssans - essspectroscopy + # Packages whose tests write reduced data files via the --file-output + # pytest option. Their output is collected and published to the + # `reduced_data_nightly` release by the `publish` job below. To publish data + # from another package, add a `--file-output`/`output_folder` fixture to + # its conftest and list it here. + include: + - package: essdiffraction + file_output: true + - package: essreflectometry + file_output: true runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 @@ -34,7 +45,48 @@ jobs: frozen: true environments: ${{ matrix.package }} - name: Run tests - run: pixi run -e ${{ matrix.package }} test ${{ matrix.package }} + run: pixi run -e ${{ matrix.package }} test ${{ matrix.package }} ${{ matrix.file_output && '-- --file-output=tests_outputs' || '' }} + - name: Upload reduced data files + if: matrix.file_output + uses: actions/upload-artifact@v7 + with: + name: reduced-data-${{ matrix.package }} + path: tests_outputs/ + if-no-files-found: warn + + publish: + name: Publish nightly reduced data + needs: test + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + - name: Download reduced data files + uses: actions/download-artifact@v8 + with: + path: ./artifacts + pattern: reduced-data-* + merge-multiple: true + - name: Publish to nightly release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + shopt -s nullglob + files=(./artifacts/*) + if [ ${#files[@]} -eq 0 ]; then + echo "No reduced data files were produced; nothing to publish." + exit 0 + fi + echo "Publishing ${#files[@]} file(s):" + printf ' %s\n' "${files[@]}" + gh release delete reduced_data_nightly --yes --cleanup-tag 2>/dev/null || true + gh release create reduced_data_nightly \ + --target "${{ github.sha }}" \ + --title "Nightly reduced data files" \ + --notes "Automated nightly build from $(date -u +%Y-%m-%dT%H:%MZ) (commit ${GITHUB_SHA::7})" \ + --prerelease \ + "${files[@]}" lower-bound: name: Lower bound ${{ matrix.package }} From 904a6a0bcac3dd8497ea4b4bcc9d1f90b219a33d Mon Sep 17 00:00:00 2001 From: Mridul Seth Date: Thu, 21 May 2026 17:00:46 +0200 Subject: [PATCH 2/2] remove trigger --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7eb424162..cb92ffc39 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,7 +1,6 @@ name: Nightly Tests on: - pull_request: workflow_dispatch: schedule: - cron: "30 1 * * 1-5"