generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (76 loc) · 1.98 KB
/
checkin.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI/PR
on:
pull_request:
merge_group:
push:
branches:
- master
- validate/*
jobs:
check_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
- name: yarn
run: yarn
- name: yarn run build
run: yarn run build
- name: check for uncommitted changes
# Ensure no changes.
run: |
git add -u . # compare after applying git EOL normalization
git diff --cached --exit-code --stat \
|| (echo "##[error] found changed files after build. please 'yarn run build'" \
"and check in all changes" \
&& git diff --cached \
&& exit 1)
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: nbgv get-version -p src
uses: ./
with:
path: src
id: nbgv
- name: Print step outputs
run: |
echo $VersionJson
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
echo 'CloudBuildNumber: ${{ steps.nbgv.outputs.CloudBuildNumber }}'
if [ -z "${{ steps.nbgv.outputs.CloudBuildNumber }}" ]; then exit 1; fi
env:
VersionJson: ${{ toJson(steps.nbgv.outputs) }}
- name: nbgv cloud -c -p src
uses: ./
with:
path: src
setCommonVars: true
- name: Print env vars
run: |
gci env:NBGV_*,env:Git*
if (-not $env:GitBuildVersion) { exit 1 }
shell: pwsh
- name: nbgv cloud -a -p src
uses: ./
with:
path: src
setAllVars: true
- name: Print env vars
run: |
gci env:NBGV_*,env:Git*
if (-not $env:NBGV_Version) { exit 1 }
shell: pwsh
- name: nbgv (stamp)
uses: ./
with:
stamp: tests/package.json
- name: print package.json version
run: npm ls nbgv-action ; exit 0
working-directory: tests
shell: bash --noprofile --norc {0}