From d61eac8ae5e8036e4eefc8d29a361216bfba0152 Mon Sep 17 00:00:00 2001 From: Wighty <53131013+PowerShellYoungTeam@users.noreply.github.com> Date: Tue, 6 Oct 2026 01:19:02 +0100 Subject: [PATCH 1/2] Add GitHub Actions CI: Jest, build and Pester Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ README.md | 5 +++ 2 files changed, 71 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..03a2879 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + web-app: + name: Web app (Jest + build) + runs-on: ubuntu-latest + defaults: + run: + working-directory: Workfolder/web-app-react + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: Workfolder/web-app-react/package-lock.json + - run: npm ci + - name: Jest + run: npm test -- --watchAll=false + env: + CI: true + - name: Build + run: npm run build + env: + CI: true + + powershell: + name: PowerShell module (Pester) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Pester and ImportExcel + shell: pwsh + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module Pester -MinimumVersion 5.0 -Scope CurrentUser -Force -SkipPublisherCheck + Install-Module ImportExcel -Scope CurrentUser -Force + - name: Pester + shell: pwsh + run: | + $cfg = New-PesterConfiguration + $cfg.Run.Path = './Workfolder/powershell/tests' + $cfg.Run.Exit = $true + $cfg.Output.Verbosity = 'Detailed' + $cfg.TestResult.Enabled = $true + $cfg.TestResult.OutputPath = 'pester-results.xml' + Invoke-Pester -Configuration $cfg + - name: Upload Pester results + if: always() + uses: actions/upload-artifact@v4 + with: + name: pester-results + path: pester-results.xml diff --git a/README.md b/README.md index c8cc8e2..3a781ab 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # RoadRouteCardMaker +[![CI](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/ci.yml/badge.svg)](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/ci.yml) + Plan a road move on OpenStreetMap and produce a military-style **route card**: the INSTRUCTIONS block (items 1-16, short-form field book wording) plus the ROUTE DETAILS table. It is built with big and heavy vehicles in mind and flags height, weight and width limits along the route. @@ -76,6 +78,9 @@ cd Workfolder\web-app-react; npm test # Jest unit tes Invoke-Pester .\Workfolder\powershell\tests -Output Detailed # Pester 5 ``` +GitHub Actions ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs Jest, the production build and +Pester on every pull request and push to `main`. + On Windows, Jest finds no tests if the repo path contains `\.` (for example `C:\Users\me\.copilot\...`). Clone the repo to a plain path such as `C:\dev\` to run them. From b1cd20d411e9089aafcec0f7a1f5cdb3f5edbe6a Mon Sep 17 00:00:00 2001 From: Wighty <53131013+PowerShellYoungTeam@users.noreply.github.com> Date: Tue, 6 Oct 2026 01:21:12 +0100 Subject: [PATCH 2/2] CI: use current action majors and Node 22 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03a2879..3639fd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: run: working-directory: Workfolder/web-app-react steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: - node-version: 20 + node-version: 22 cache: npm cache-dependency-path: Workfolder/web-app-react/package-lock.json - run: npm ci @@ -41,7 +41,7 @@ jobs: name: PowerShell module (Pester) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Install Pester and ImportExcel shell: pwsh run: | @@ -60,7 +60,7 @@ jobs: Invoke-Pester -Configuration $cfg - name: Upload Pester results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pester-results path: pester-results.xml