-
-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (43 loc) · 1.32 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
---
name: Unit Tests
on:
pull_request: {}
push:
branches:
- "main"
jobs:
unit-tests:
name: Tests
timeout-minutes: 5
runs-on: ubuntu-latest
env:
CLOUDMERSIVE_API_KEY: ${{ secrets.CLOUDMERSIVE_API_KEY }}
DEEPAI_API_KEY: ${{ secrets.DEEPAI_API_KEY }}
PICPURIFY_API_KEY: ${{ secrets.PICPURIFY_API_KEY }}
SIGHTENGINE_API_USER: ${{ secrets.SIGHTENGINE_API_USER }}
SIGHTENGINE_API_SECRET: ${{ secrets.SIGHTENGINE_API_SECRET }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Cache node_modules
id: cache
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Unit tests
run: yarn test
if: github.ref != 'refs/heads/main'
- name: Unit tests with coverage
uses: paambaati/codeclimate-action@v6.0.0
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: yarn test
debug: true