Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back in PR Preview Workflow #341

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 17 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on:
pull_request:
branches: [main, zig-master]


env:
ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || '0.13.0' }}
ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || vars.TARGET_ZIG_VERSION }}

jobs:
build:
Expand All @@ -28,16 +27,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-latest,
]
port_dir: [
gigadevice/gd32,
raspberrypi/rp2xxx,
stmicro/stm32,
]
os: [ubuntu-latest, windows-latest, macos-latest]
port_dir: [gigadevice/gd32, raspberrypi/rp2xxx, stmicro/stm32]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -53,11 +44,7 @@ jobs:
name: Unit Test Regz
strategy:
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-latest,
]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -74,11 +61,7 @@ jobs:
name: Unit Test UF2
strategy:
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-latest,
]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand Down Expand Up @@ -134,17 +117,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
example_dir: [
espressif/esp,
gigadevice/gd32,
microchip/avr,
microchip/atsam,
nordic/nrf5x,
nxp/lpc,
stmicro/stm32,
raspberrypi/rp2xxx,
wch/ch32v,
]
example_dir:
[
espressif/esp,
gigadevice/gd32,
microchip/avr,
microchip/atsam,
nordic/nrf5x,
nxp/lpc,
stmicro/stm32,
raspberrypi/rp2xxx,
wch/ch32v,
]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
version: ${{ vars.TARGET_ZIG_VERSION }}

- name: Extract version
run: echo "MICROZIG_VERSION=$(zig build package -- get-version)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
version: ${{ vars.TARGET_ZIG_VERSION }}

- name: Download and install GitHub CLI
run: |
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/website-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy PR Preview Website

permissions:
contents: read

on:
pull_request:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ vars.TARGET_ZIG_VERSION }}
- name: Build Website
run: zig build
working-directory: website
- name: Publish Website Preview
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }}
ARGS: "-vzrli"
SOURCE: website/zig-out
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
REMOTE_PORT: ${{ secrets.DEPLOY_PORT }}
TARGET: ${{ format('{0}/staging/pulls/{1}', secrets.DEPLOY_ROOT_DATA_PATH, github.event.number) }}
pr-comment:
runs-on: ubuntu-latest
needs: deploy
permissions:
pull-requests: write
steps:
- uses: mshick/add-pr-comment@v2
with:
message: |
Heya!
You can check out a preview of your PR at [${{vars.WEBSITE_STAGING_HOST}}/pulls/${{ github.event.number}}](${{vars.WEBSITE_STAGING_HOST}}/pulls/${{ github.event.number}})!
Loading