Created
August 2, 2023 16:01
-
-
Save moritzsalla/b5ffa4acf49fc7c8c5d515fc971e6b78 to your computer and use it in GitHub Desktop.
Github action - Unit test
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: Tests | |
on: | |
pull_request: | |
jobs: | |
Unit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}- | |
${{ runner.os }}-node- | |
${{ runner.os }}- | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: | | |
npm run test:ci | |
env: | |
CI: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edit caching can actually be detrimental to performance if there's not a ton of dependencies