-
-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (51 loc) · 1.46 KB
/
unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
name: Unit Tests
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- dist/**
- src/**
- jest.config.json
push:
branches:
- main
defaults:
run:
shell: sh
jobs:
unit-tests:
name: Unit Tests
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Cache yarn dependencies
id: yarn-cache
uses: actions/cache@v4
with:
path: |
.yarn/cache
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Unit tests
if: github.ref != 'refs/heads/main'
env:
DEEPL_API_KEY: ${{ secrets.DEEPL_API_KEY }}
MYMEMORY_API_KEY: ${{ secrets.MYMEMORY_API_KEY }}
run: yarn test
- name: Unit tests with coverage
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: paambaati/codeclimate-action@v9.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
DEEPL_API_KEY: ${{ secrets.DEEPL_API_KEY }}
MYMEMORY_API_KEY: ${{ secrets.MYMEMORY_API_KEY }}
with:
coverageCommand: yarn test
debug: true