Skip to content

Commit

Permalink
ci(project): gh action test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jul 18, 2023
1 parent 311510f commit 10c6ccd
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Redac CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
list-packages:
name: List Packages
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.get-folders.outputs.packages }}
steps:
- uses: actions/checkout@v3
- id: get-folders
working-directory: packages
shell: bash
run: |
packages=$(tree -J -d -L 1 | jq -c '.[0].contents | map(.name)')
echo "packages=$packages" >> $GITHUB_OUTPUT
test:
name: Package Test
needs: [list-packages]
runs-on: ubuntu-22.04
strategy:
fail-fast: false # avoid cancel all in-progress jobs if any fails
matrix:
node-version: [18.x]
package: ${{ fromJson(needs.list-packages.outputs.packages)}}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install package dependencies
run: yarn --frozen-lockfile
- name: Test
shell: bash
run: |
if [ ${{ matrix.package }} != redac ]; then
npx lerna run test --scope=@redac/${{ matrix.package }}
else
npx lerna run test --scope=${{ matrix.package }}
fi

0 comments on commit 10c6ccd

Please sign in to comment.