Skip to content
Merged
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
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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@v7
- uses: actions/setup-node@v7
with:
node-version: 22
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@v7
- 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@v7
with:
name: pester-results
path: pester-results.xml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.

Expand Down
Loading