Merge pull request #9 from kjanat/dependabot/github_actions/dot-githu… #12
This file contains hidden or 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: Test with jest | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| release: | |
| types: [ created ] | |
| workflow_dispatch: | |
| # schedule: | |
| # - cron: '0 0 * * *' # Runs every day at midnight | |
| jobs: | |
| test: | |
| name: Test on node ${{ matrix.node }} and ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macOS-latest] | |
| node: ['18.x', '20.x', 'latest'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache node modules | |
| id: cache-npm | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| # npm cache files are stored in `~/.npm` on Linux/macOS | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
| name: List the state of node modules | |
| continue-on-error: true | |
| run: npm list | |
| - name: Use Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install dependencies | |
| run: npm ci --include=dev | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| if: success() && github.event_name == 'release' | |
| with: | |
| name: codecov-umbrella | |
| fail_ci_if_error: true | |
| directory: ./coverage | |
| files: ./unit/clover.xml,./integration/clover.xml | |
| flags: unittests | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |