-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.45 KB
/
__test-action-setup-node.yml
File metadata and controls
50 lines (41 loc) · 1.45 KB
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
49
50
name: Internal - Tests for "setup-node" action
on:
workflow_call:
permissions: {}
jobs:
test:
name: Test "setup-node" (${{ matrix.working-directory }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
include:
- working-directory: tests/npm
run-script-command: npm run
- working-directory: tests/pnpm
run-script-command: pnpm
- working-directory: tests/pnpm-package-manager
run-script-command: pnpm
- working-directory: tests/yarn
run-script-command: yarn
steps:
- name: Arrange - Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Arrange - Configure Node.js version
run: echo "lts/*" > .nvmrc
working-directory: ${{ matrix.working-directory }}
- name: Act - Run "setup-node" action
id: act-setup-node
uses: ./actions/setup-node
with:
working-directory: ${{ matrix.working-directory }}
- name: Assert - Check "setup-node" outputs
env:
RUN_SCRIPT_COMMAND: ${{ steps.act-setup-node.outputs.run-script-command }}
EXPECTED_RUN_SCRIPT_COMMAND: ${{ matrix.run-script-command }}
run: |
if [ "$RUN_SCRIPT_COMMAND" != "$EXPECTED_RUN_SCRIPT_COMMAND" ]; then
echo "setup-node outputs run-script-command is not valid"
exit 1
fi