From ed091037c31c5583f4f2b3cd697b7e09d1a8f8a8 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 13 May 2025 19:08:19 +0200 Subject: [PATCH 1/2] feat: initial CI for templates --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2f7a955 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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) 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 test + Pop-Location + } + + - name: (non-Windows) 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 test + popd + done From 6f88e15874b49d74bc31b85700d1e6291419d16a Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 13 May 2025 19:13:41 +0200 Subject: [PATCH 2/2] fix --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f7a955..cbde906 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Build run: yarn build - - name: (Windows) Setup and test templates + - name: (Windows, Yarn v1) Setup and test templates if: ${{ matrix.os == 'windows-latest' }} run: | Set-Location template @@ -45,11 +45,11 @@ jobs: yarn install yarn fmt:check yarn build - yarn test + yarn jest Pop-Location } - - name: (non-Windows) Setup and test templates + - name: (non-Windows, Yarn v1) Setup and test templates if: ${{ matrix.os != 'windows-latest' }} run: | cd template @@ -58,6 +58,6 @@ jobs: yarn install yarn fmt:check yarn build - yarn test + yarn jest popd done