Skip to content

feat: initial CI for templates #21

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
pull_request:
branches: ["**"]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# All unset values default to none
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
permissions: read-all

jobs:
test:
strategy:
fail-fast: false
matrix:
node-version: [22]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: (Windows, Yarn v1) Setup and test templates
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-Location template
Get-ChildItem -Directory | ForEach-Object {
Push-Location $_.Name
yarn install
yarn fmt:check
yarn build
yarn jest
Pop-Location
}

- name: (non-Windows, Yarn v1) Setup and test templates
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd template
for d in */; do
pushd "$d"
yarn install
yarn fmt:check
yarn build
yarn jest
popd
done