Skip to content

Commit

Permalink
feat: add more testing (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
promiseofcake authored Feb 6, 2023
1 parent 62f4ca4 commit 4b142d7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/
# We need to make sure the checked-in `dist/index.js` actually matches what we expect it to be.
name: check dist/

on:
push:
Expand All @@ -22,18 +18,14 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run prepare

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
Expand All @@ -42,7 +34,6 @@ jobs:
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "units-test"
name: "unit-test"
on:
pull_request:

jobs:
# compile
units:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: "units-test"
name: "integration-test"
on:
push:
branches:
- main
- 'releases/*'

jobs:
# test action works running from the graph
test:
integration:
runs-on: ubuntu-latest
env:
OUTPUT_VALUE: overloaded output value
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "smoke-test"
on:
push:
branches:
- main
- 'releases/*'

jobs:
smoke:
runs-on: ubuntu-latest
env:
OUTPUT_VALUE: overloaded output value
steps:
- name: Capture triggering branch name
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: promiseofcake/circleci-trigger-action@v1
with:
user-token: ${{ secrets.CIRCLECI_TOKEN }}
project-slug: ${{ github.repository }}
branch: ${{ env.BRANCH_NAME }}
payload: '{"run_output_workflow": true, "output_value": "${{ env.OUTPUT_VALUE }}"}'

0 comments on commit 4b142d7

Please sign in to comment.