diff --git a/gpu-dawn/.github/FUNDING.yml b/gpu-dawn/.github/FUNDING.yml new file mode 100644 index 00000000..99fd1066 --- /dev/null +++ b/gpu-dawn/.github/FUNDING.yml @@ -0,0 +1 @@ +github: slimsag diff --git a/gpu-dawn/.github/pull_request_template.md b/gpu-dawn/.github/pull_request_template.md new file mode 100644 index 00000000..535c4f19 --- /dev/null +++ b/gpu-dawn/.github/pull_request_template.md @@ -0,0 +1,5 @@ +Please send your change to [the main repository](https://github.com/hexops/mach/tree/main/gpu-dawn) instead, sorry for the trouble! + +This helps us avoid some complex merge conflicts we run into when changes are made to both repositories and history needs to be reconciled. Keeping PRs in just that repository enables us to use `git subtree` to trivially keep the two repositories in sync. + +Once your PR is merged over there, it'll automatically sync to this repository. diff --git a/gpu-dawn/.github/workflows/ci.yml b/gpu-dawn/.github/workflows/ci.yml new file mode 100644 index 00000000..86ed5ec1 --- /dev/null +++ b/gpu-dawn/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI +on: + - push + - pull_request +jobs: + x86_64-linux: + runs-on: ubuntu-latest + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push + # to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Zig + run: | + sudo apt install xz-utils + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.9.0-dev.2023+16b753549.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + - name: test + run: zig build test && find zig-out/ + # TODO(build-system): enable windows CI here once gpu-dawn builds under Windows + # x86_64-windows: + # runs-on: windows-latest + # # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push + # # to the branch. + # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Install Git + # run: choco install git + # - name: Setup Zig + # run: | + # Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.9.0-dev.2023+16b753549.zip" -OutFile "C:\zig.zip" + # cd C:\ + # 7z x zig.zip + # Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.9.0-dev.2023+16b753549\" + # - name: test + # run: zig build test && find zig-out/ + x86_64-macos: + runs-on: macos-latest + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push + # to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Zig + run: | + brew install xz + sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.9.0-dev.2023+16b753549.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + - name: test + run: zig build test && find zig-out/ + env: + AGREE: true diff --git a/gpu-dawn/.github/workflows/m1_ci.yml b/gpu-dawn/.github/workflows/m1_ci.yml new file mode 100644 index 00000000..319477e2 --- /dev/null +++ b/gpu-dawn/.github/workflows/m1_ci.yml @@ -0,0 +1,25 @@ +name: CI +on: + # SECURITY: This must be a push event only, otherwise our M1 mac runner would be compromised by + # third-party pull requests which could run arbitrary code. This way, we can restrict it to + # collaborators of the repository only. + # + # Whenever GitHub Actions gets official M1 support, we can use that for PRs and get rid of this + # self-hosted runner: https://github.com/actions/virtual-environments/issues/2187 + - push +jobs: + aarch64-macos: + runs-on: [self-hosted, macOS, ARM64] + defaults: + run: + shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}" + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Zig + run: | + zig version + - name: test + run: zig build test && find zig-out/ + env: + AGREE: true diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index 64d853fc..38142329 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -15,6 +15,7 @@ pub fn build(b: *Builder) void { const main_tests = b.addTest("src/main.zig"); main_tests.setBuildMode(mode); + link(b, main_tests, .{}); const test_step = b.step("test", "Run library tests"); test_step.dependOn(&main_tests.step);