generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 17
67 lines (64 loc) · 2.03 KB
/
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
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
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
tags:
- 'v[0-9]*'
branches:
- main
- 'v[0-9]*'
jobs:
build: # make sure build/ci work properly
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run format && git diff-files
- run: npm run test
- run: npm run package
- name: Verify that `dist/index.js` is up to date
shell: bash
run: |
# `ncc` produces output with mixed line endings
test -z "$(git diff -aw HEAD -- ':(exclude)dist/index.js.map' | tee diff.txt)" || {
echo 'Files changed after `npm run package`'
cat diff.txt
exit 1
}
- uses: actions/upload-artifact@v2
if: failure()
with:
name: diff.txt
path: diff.txt
test: # make sure the action works on a clean machine without building
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Run this Action in-place
uses: ./
- name: Verify that the Bash of Git for Windows' SDK is used
shell: bash
run: |
set -ex
test ! -e .tmp
echo "This is the MSYS2 pseudo root: $(cygpath -aw /)"
test "gcc is /mingw64/bin/gcc" = "$(type gcc)"
test "prove is /usr/bin/core_perl/prove" = "$(type prove)"
prove -V
printf '%s\n' \
"#include <stdio.h>" \
'' \
'int main()' \
'{' \
' printf("Hello, world!\n");' \
' return 0;' \
'}' >hello-world.c
gcc -o hello-world.exe hello-world.c
hello="$(./hello-world.exe)"
test 'Hello, world!' = "$hello"
# Verify that the locale is set, enabling `grep -P` to work
test 123 = "$(printf '1248\n123\n' | grep -P '2(?!4)')"
# Verify that /dev/fd/<pid> works
test hello = "$(cat <(echo hello))"