From afde3346c14dcf92bb609d235605071f04927f55 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 16:11:18 -0800 Subject: [PATCH 1/6] Template test script. --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6084e65 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Run Tests + +on: [push, pull_request] + +jobs: + setup: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Test Templates + run: | + templates=$(find . -maxdepth 1 -type d -name 'js*' -o -name 'ts*') + for template in $templates; do + pushd "$template" + pnpm install + pnpm test + popd + done From 6818a81bd01131daa01bc76f70475361db1ea483 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 16:37:54 -0800 Subject: [PATCH 2/6] Going with npm since pnpm isn't installed. --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6084e65..d64645a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,14 +14,13 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'pnpm' - name: Test Templates run: | templates=$(find . -maxdepth 1 -type d -name 'js*' -o -name 'ts*') for template in $templates; do pushd "$template" - pnpm install - pnpm test + npm install + npm test popd done From d4f8f127a76d30e45dbed73d48b8ada9066ec7e6 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 16:42:35 -0800 Subject: [PATCH 3/6] Added echo to inform progress. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d64645a..0bc0069 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,7 @@ jobs: templates=$(find . -maxdepth 1 -type d -name 'js*' -o -name 'ts*') for template in $templates; do pushd "$template" + echo Testing template $template npm install npm test popd From 5de34324c63edbfec5d3aaf1f204e1751fa3686f Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 17:06:22 -0800 Subject: [PATCH 4/6] Added if-present option for tests. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bc0069..cf884fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,6 @@ jobs: pushd "$template" echo Testing template $template npm install - npm test + npm test --if-present popd done From f99e115b52dba52670dd63d2567868955d20a155 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 17:09:08 -0800 Subject: [PATCH 5/6] Sorting templates. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf884fb..1fafe08 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Test Templates run: | - templates=$(find . -maxdepth 1 -type d -name 'js*' -o -name 'ts*') + templates=$(find . -maxdepth 1 -s -type d -name 'js*' -o -name 'ts*') for template in $templates; do pushd "$template" echo Testing template $template From ec4a71cef20c7cd1f8dad9036f8460732c19d98b Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Sun, 3 Dec 2023 17:16:54 -0800 Subject: [PATCH 6/6] Changed sort strategy. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fafe08..8ed15af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Test Templates run: | - templates=$(find . -maxdepth 1 -s -type d -name 'js*' -o -name 'ts*') + templates=$(find . -maxdepth 1 -type d -name 'js*' -o -name 'ts*' | sort) for template in $templates; do pushd "$template" echo Testing template $template