Add nightly tests (#433)

This commit is contained in:
Andrzej Janik
2025-07-25 01:14:06 +02:00
committed by GitHub
parent e8e20294a6
commit c1dda55235
2 changed files with 80 additions and 0 deletions

56
.github/workflows/nightly_tests.yml vendored Normal file
View File

@ -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

View File

@ -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