From c1dda55235b6d53caf4547fa1a275ae8e110bd8c Mon Sep 17 00:00:00 2001 From: Andrzej Janik Date: Fri, 25 Jul 2025 01:14:06 +0200 Subject: [PATCH] Add nightly tests (#433) --- .github/workflows/nightly_tests.yml | 56 +++++++++++++++++++++ .github/workflows/trigger_nightly_tests.yml | 24 +++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/nightly_tests.yml create mode 100644 .github/workflows/trigger_nightly_tests.yml diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml new file mode 100644 index 0000000..9a9099a --- /dev/null +++ b/.github/workflows/nightly_tests.yml @@ -0,0 +1,56 @@ +name: Nightly tests +on: + workflow_call: + workflow_dispatch: + +env: + ROCM_VERSION: "6.3.1" + TEST_THREADS: 24 + +jobs: + run_tests: + runs-on: gpu_large + steps: + - uses: actions/checkout@v4 + with: + repository: 'vosen/ZLUDA' + path: zluda-src + sparse-checkout: | + .github/workflows/rocm_setup_run.sh + - name: Install ROCm + run: sudo bash zluda-src/.github/workflows/rocm_setup_run.sh ${{ env.ROCM_VERSION }} + - uses: actions/checkout@v4 + with: + repository: 'vosen/ptx_tests' + - uses: robinraju/release-downloader@v1 + with: + repository: 'vosen/ZLUDA' + latest: true + preRelease: true + extract: true + fileName: 'zluda-linux-*.tar.gz' + - name: Build and run + run: | + pids=() + exit_codes=() + for i in $(seq 0 $((${{ env.TEST_THREADS }} - 1))); do + cargo run -r -- zluda/libcuda.so.1 --shard-index $i --shard-count ${{ env.TEST_THREADS }} > output_$i.log 2>&1 & + pids+=($!) + done + for pid in "${pids[@]}"; do + wait $pid + exit_codes+=($?) + done + error_occurred=0 + for i in "${!exit_codes[@]}"; do + if [ ${exit_codes[$i]} -ne 0 ]; then + error_occurred=1 + fi + done + exit $error_occurred + - name: Upload logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: output_logs + path: output_*.log \ No newline at end of file diff --git a/.github/workflows/trigger_nightly_tests.yml b/.github/workflows/trigger_nightly_tests.yml new file mode 100644 index 0000000..0f67346 --- /dev/null +++ b/.github/workflows/trigger_nightly_tests.yml @@ -0,0 +1,24 @@ +name: Nightly tests +on: + schedule: + - cron: "0 8 * * *" + +jobs: + check_last_nightly_run: + runs-on: 'ubuntu-latest' + outputs: + last_sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }} + steps: + - uses: octokit/request-action@v2.4 + id: check_last_run + with: + route: GET /repos/${{github.repository}}/actions/workflows/nightly_tests.yml/runs?per_page=1&status=completed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: "echo Last nightly build: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}" + build: + runs-on: gpu_large + needs: [check_last_nightly_run] + if: needs.check_last_nightly_run.outputs.last_sha != github.sha + uses: ./.github/workflows/nightly_tests.yml + secrets: inherit \ No newline at end of file