Merge pull request #297 from htdangkhoa/develop #66
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: build | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: ['16', '18', '20'] | |
name: Node ${{ matrix.node }} testing | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install Dependencies | |
run: yarn install --ignore-engines | |
- run: | | |
echo repo_token: ${{ secrets.COVERALLS_TOKEN }} > .coveralls.yml | |
- name: Test | |
run: yarn test:cov | |
- name: Test report with Node ${{ matrix.node }} | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Test report with Node ${{ matrix.node }} | |
path: junit.xml | |
reporter: jest-junit | |
- name: Coveralls | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: ${{matrix.os}}-node-${{ matrix.node }} | |
parallel: true | |
finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |