-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.44 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout project source
uses: actions/[email protected]
- name: Read Node.js version from .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: ${{steps.nvmrc.outputs.NVMRC}}
- name: Cache Node.js modules
uses: actions/[email protected]
with:
path: ~/.npm
key: ${{runner.OS}}-node-${{steps.nvmrc.outputs.NVMRC}}-${{hashFiles('**/package-lock.json')}}
restore-keys: |
${{runner.OS}}-node-${{steps.nvmrc.outputs.NVMRC}}
- name: Install Node.js dependencies
run: npm ci
- name: Run the bash test script
run: script/test
- name: Cache PowerShell modules
id: cache-powershell-modules
uses: actions/[email protected]
with:
path: ~/.local/share/powershell/Modules
# Include a date as a manual cache buster if you want to install newer module versions
key: ${{runner.os}}-powershell-modules-2023-04-01
- name: Install powershell script analyser
if: steps.cache-powershell-modules.outputs.cache-hit != 'true'
run: Install-Module -Name PSScriptAnalyzer -Force
shell: pwsh
- name: Run the powershell test script
run: script/test.ps1
shell: pwsh