Skip to content

Commit ea4dff2

Browse files
committed
test: add an integration test that the published package works
1 parent dd4e37b commit ea4dff2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/push.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,32 @@ jobs:
1212
- run: yarn install
1313
- run: make build
1414
- run: yarn test
15+
- name: Integration test
16+
run: |
17+
dir=$(pwd)
18+
tmp=$(mktemp -d)
19+
20+
yarn pack
21+
cd $tmp
22+
yarn init -y
23+
yarn add "$dir/actionlint-v0.0.0.tgz"
24+
25+
# verify package exports
26+
ls -la "node_modules/actionlint/$(jq ".exports.types" -r node_modules/actionlint/package.json)"
27+
ls -la "node_modules/actionlint/$(jq ".exports.node.import" -r node_modules/actionlint/package.json)"
28+
ls -la "node_modules/actionlint/$(jq ".exports.node.require" -r node_modules/actionlint/package.json)"
29+
ls -la "node_modules/actionlint/$(jq ".exports.browser" -r node_modules/actionlint/package.json)"
30+
31+
cat << EOF > test.js
32+
const linter = require('actionlint').createLinter();
33+
linter('on: psuh', 'push.yml').then(
34+
(results) => process.exit(results.length > 0 ? 0 : 1),
35+
(err) => { console.error(err); process.exit(1); }
36+
);
37+
EOF
38+
39+
# test that the linter works
40+
node test.js
1541
- name: release
1642
if: github.ref == 'refs/heads/main'
1743
run: npx --yes semantic-release --branches main

0 commit comments

Comments
 (0)