vello/.github/workflows/push-shader.yml
Raph Levien 682e4b769f Shader compilation in GitHub Actions
This patch sets up very basic CI (right now just cargo fmt) but more importantly compiles shaders in a GitHub Action.

Any PR to branches other than main will run shader compilation. Any push to the dev branch will run shader compilation and then merge to main.

Closes #177
2022-06-16 21:19:39 -07:00

38 lines
1.1 KiB
YAML

on:
push:
branches:
- dev
jobs:
push-shaders:
runs-on: windows-latest
name: compile shaders and push to main
steps:
- uses: actions/checkout@v3
with:
# need history to make the merge work
# possibly we can optimize this and set
# allow-unrelated-histories on merge
fetch-depth: 0
- name: prepare repo for compilation
run: |
git fetch origin main
git switch main
git merge dev -m "merge from dev branch"
git rm -r --ignore-unmatch piet-gpu/shader/gen
mkdir piet-gpu/shader/gen
- uses: ./.github/actions/shader
- name: commit
id: commit
continue-on-error: true
run: |
git add piet-gpu/shader/gen
git config user.name "Commit by GitHub Action"
git config user.email "nobody@example.com"
git commit -m "commit compiled shaders"
- name: push
if: steps.commit.outcome == 'success'
run: |
git show-ref
git push origin main