Skip to content

Commit

Permalink
feat: sync ci from template-module
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Jan 27, 2024
1 parent a818837 commit 9e0b334
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build & Test

on:
push:
branches:
- master
pull_request:
branches:
- master
tags:
- "v*.*.*"

jobs:
macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64-macos, aarch64-macos]
optimize: [ReleaseSmall, Debug]
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
zig build -Dtarget=${{ matrix.target }} -Doptimize=${{ matrix.optimize }}
- name: Test
run: |
zig build test
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x86_64-windows, aarch64-windows]
optimize: [ReleaseSmall, Debug]
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
zig build -Dtarget=${{ matrix.target }} -Doptimize=${{ matrix.optimize }}
- name: Test
run: |
zig build test
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-linux, aarch64-linux, riscv64-linux]
optimize: [ReleaseSmall, Debug]
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
zig build -Dtarget=${{ matrix.target }} -Doptimize=${{ matrix.optimize }}
- name: Test
run: |
zig build test
42 changes: 42 additions & 0 deletions .github/workflows/update-phantom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update Phantom UI

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}

jobs:
update-phantom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: main
- uses: actions/checkout@v4
with:
repository: PhantomUIx/core
path: phantom-core
- uses: goto-bus-stop/setup-zig@v2
- name: Update Phantom UI
run: |
export PHANTOM_SHA=$(git -C phantom-core rev-parse HEAD)
pushd main
git switch -c update-phantom/$PHANTOM_SHA
zig fetch --save=phantom https://github.com/PhantomUIx/core/archive/$PHANTOM_SHA.tar.gz
git config user.name "GitHub Actions Bot"
git config user.email "<>"
if ! git diff-index --quiet HEAD --; then
git add build.zig.zon
git commit build.zig.zon -m "chore: update core to $PHANTOM_SHA"
export HAS_CHANGES=yes
else
export HAS_CHANGES=no
fi
popd
- name: Open PR
uses: peter-evans/create-pull-request@v5
if: env.HAS_CHANGES == 'yes'
with:
title: "Update Phantom UI core to ${{ env.PHANTOM_SHA }}"
branch: update-phantom/${{ env.PHANTOM_SHA }}
path: main

0 comments on commit 9e0b334

Please sign in to comment.