Skip to content

Pin PSScriptAnalyzer 1.25.0 and lint the tests too. #15

Pin PSScriptAnalyzer 1.25.0 and lint the tests too.

Pin PSScriptAnalyzer 1.25.0 and lint the tests too. #15

Workflow file for this run

name: CI and Pages
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
site:
name: Site checks and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run hygiene
- run: npm run validate
- run: npm test
- run: npm run build:gh
- run: npm run check-links
- name: Accessibility (axe, light and dark)
run: |
npx playwright install --with-deps chromium
npm run a11y
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: _site
powershell:
name: Pester and PSScriptAnalyzer (${{ matrix.shell }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
shell: [pwsh, powershell]
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Install Pester and PSScriptAnalyzer
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Pester -MinimumVersion 5.5.0 -MaximumVersion 5.99.99 -Scope CurrentUser -Force -SkipPublisherCheck
Install-Module PSScriptAnalyzer -RequiredVersion 1.25.0 -Scope CurrentUser -Force
- name: Run tests
run: ./tests/run.ps1 -Lint
deploy:
name: Deploy to GitHub Pages
needs: [site, powershell]
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pages-deploy
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
id: deployment