Skip to content

Commit

Permalink
test: add integration tests to workflow (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jveldboom authored Feb 12, 2023
1 parent 9dd8821 commit 92fa3b7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,43 @@ jobs:
echo "Detected uncommitted changes after build within the ./dist directory"
exit 1
fi
integration-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Version - no input
id: no-input
uses: ./

- name: Version - default-bump input
id: default-bump
uses: ./
with:
default-bump: minor

- name: Check outputs
uses: actions/github-script@v6
with:
script: |
const assert = require('assert')
const outputs = {
default: ${{ toJSON(steps.no-input.outputs) }},
defaultBump: ${{ toJSON(steps.default-bump.outputs) }}
}
// check default / no-input outputs
const [ major, minor, patch ] = outputs.default.version.split('.')
assert.deepEqual(outputs.default['version-with-prefix'], `v${major}.${minor}.${patch}`)
assert.deepEqual(outputs.default.major, major)
assert.deepEqual(outputs.default['major-with-prefix'], `v${major}`)
assert.deepEqual(outputs.default.minor, minor)
assert.deepEqual(outputs.default.patch, patch)
// check minor bump
assert.deepEqual(Number(outputs.default.minor) + 1, outputs.defaultBump.minor)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:

## TODO
- [ ] Release v1 of action
- [ ] Workflow to run regresssion tests with compiled action
- [x] Workflow to run regresssion tests with compiled action
- [ ] list action in marketplace
- [ ] Improve index.js file
- Should it be simplified and wrapped in a try/catch?
Expand Down

0 comments on commit 92fa3b7

Please sign in to comment.