-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (50 loc) · 1.94 KB
/
push.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
name: CI
on: push
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup TinyGo
uses: ./.github/actions/setup-tinygo
with:
version: fce42fc7fa22f9a8061ef8700e2d17a6082f782e # latest commit on dev at the time of writing
- name: Setup Node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Build
run: make build
- name: Test
run: yarn test
- name: Integration test
run: |
dir=$(pwd)
tmp=$(mktemp -d)
yarn pack
cd "$tmp" || exit 1
yarn init -y
yarn add "$dir/actionlint-v0.0.0.tgz" typescript @types/node
# verify package exports
ls -la "node_modules/actionlint/$(jq ".exports.types" -r node_modules/actionlint/package.json)"
ls -la "node_modules/actionlint/$(jq ".exports.node.import" -r node_modules/actionlint/package.json)"
ls -la "node_modules/actionlint/$(jq ".exports.node.require" -r node_modules/actionlint/package.json)"
ls -la "node_modules/actionlint/$(jq ".exports.browser" -r node_modules/actionlint/package.json)"
cat << EOF > test.mjs
import { createLinter } from 'actionlint';
createLinter().then(lint => {
const results = lint('on: psuh', 'push.yml');
process.exit(results.length > 0 ? 0 : 1)
}, (err) => { console.error(err); process.exit(1); });
EOF
# test that the linter works
node test.mjs
# test that the types are correctly included
mv test.mjs test.ts
yarn tsc --noEmit --strict ./test.ts
- name: release
if: github.ref == 'refs/heads/main'
run: npx --yes semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}