Initial textures support #804
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ZLUDA | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_PROFILE: release | |
| SCCACHE_GHA_ENABLED: "true" | |
| RUSTC_WRAPPER: "sccache" | |
| SCCACHE_MAX_FRAME_LENGTH: "104857600" # 100 MB | |
| ROCM_VERSION: "6.3.4" | |
| AMDGPU_VERSION: "6.4.4" | |
| jobs: | |
| check_whitespace: | |
| name: Check Whitespace | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - run: | | |
| sudo apt install fd-find | |
| fdfind \ | |
| --exclude '*.bc' \ | |
| --exclude '*.exe' \ | |
| --exclude '*.lib' \ | |
| --exclude ext/detours \ | |
| --strip-cwd-prefix \ | |
| --type file \ | |
| --exec bash -c ' | |
| diff \ | |
| --unified \ | |
| --label "a/$0" \ | |
| --label "b/$0" \ | |
| <(cat "$0") \ | |
| <(sed --regexp-extended "s/\s+$//; \$a\\" "$0") | |
| ' | |
| formatting: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt | |
| - name: Check Rust formatting | |
| uses: actions-rust-lang/rustfmt@v1 | |
| build_linux: | |
| name: Build (Linux) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: jlumbroso/[email protected] | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - name: Install ROCm | |
| run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/[email protected] | |
| - name: Build | |
| # https://github.com/actions/upload-artifact/issues/39 | |
| run: | | |
| cargo xtask zip --profile ${{ env.CARGO_PROFILE }} | |
| mkdir target/${{ env.CARGO_PROFILE }}/zluda | |
| tar -xzf target/${{ env.CARGO_PROFILE }}/zluda.tar.gz -C target/${{ env.CARGO_PROFILE }}/zluda | |
| - name: Set revision hash | |
| run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zluda-linux-${{ env.SHORT_SHA }} | |
| path: target/${{ env.CARGO_PROFILE }}/zluda | |
| build_windows: | |
| name: Build (Windows) | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/[email protected] | |
| - name: Build | |
| run: | | |
| cargo xtask zip --profile ${{ env.CARGO_PROFILE }} | |
| Expand-Archive -Path target/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda | |
| - name: Set revision hash | |
| run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zluda-windows-${{ env.SHORT_SHA }} | |
| path: target/${{ env.CARGO_PROFILE }}/zluda | |
| build_tests: | |
| name: Build AMD GPU unit tests | |
| runs-on: gpu_small | |
| outputs: | |
| test_package: ${{ steps.upload_artifacts.outputs.artifact-id }} | |
| steps: | |
| - uses: jlumbroso/[email protected] | |
| - name: Install build tools | |
| run: | | |
| sudo apt update | |
| sudo apt install -y git git-lfs build-essential cmake | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Install ROCm | |
| run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/[email protected] | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-export | |
| - name: Build | |
| run: | | |
| cargo export target/tests -- test --features ci_build --workspace \ | |
| --exclude cuda_macros \ | |
| --exclude ptx_parser_macros \ | |
| --exclude zluda_inject \ | |
| --exclude zluda_redirect | |
| mkdir -p target/amdgpu | |
| bash .github/workflows/move_tests.sh target/tests amdgpu | |
| strip target/amdgpu/* | |
| - name: Upload | |
| id: upload_artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tests | |
| path: target/amdgpu | |
| retention-days: 7 | |
| run_tests: | |
| name: Run AMD GPU unit tests | |
| runs-on: gpu_small | |
| needs: [build_tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| sparse-checkout: .github | |
| - name: Install ROCm | |
| run: sudo bash .github/workflows/rocm_setup_run.sh ${{ env.ROCM_VERSION }} ${{ env.AMDGPU_VERSION }} | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| artifact-ids: ${{ needs.build_tests.outputs.test_package }} | |
| path: target | |
| - name: Run tests | |
| run: | | |
| chmod +x target/tests/* | |
| error_occurred=0 | |
| for exe in target/tests/*; do | |
| ./"$exe" _amdgpu || { error_occurred=1; true; } | |
| done | |
| exit $error_occurred |