Merge pull request #27 from prasetyodimas/main #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- '*' | |
- '*/*' | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.20.2 | |
- name: Install dependencies | |
run: npm install --force | |
- name: Build of code | |
run: npm run build | |
- name: Run unit tests | |
id: unit-tests | |
run: | | |
if npm run test:ci; then | |
echo "Tests passed" | |
echo "::set-output name=status::success" | |
else | |
echo "Tests failed" | |
echo "::set-output name=status::failure" | |
fi | |
- name: Check test status | |
run: exit 1 | |
if: ${{ steps.unit-tests.outputs.status == 'failure' }} |