-
Notifications
You must be signed in to change notification settings - Fork 7
36 lines (31 loc) · 828 Bytes
/
test.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
name: Test
on: [push]
env:
EXPECTED: "3.14.16"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: mkdir ./test_1
- run: |
echo '{"version": "${{ env.EXPECTED }}"}' > ./test_1/package.json
- name: Test 1
id: package_ver
uses: ./
with:
path: ./test_1
- name: Check results
uses: actions/github-script@v7
env:
RECEIVED: ${{ steps.package_ver.outputs.version }}
with:
script: |
const { EXPECTED, RECEIVED } = process.env;
if (RECEIVED !== RECEIVED)
core.setFailed(`Expected [${EXPECTED}], but got [${RECEIVED}]`)