This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
59 lines (59 loc) · 2.18 KB
/
codeclimate-workflow-pr.yaml
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
55
56
57
58
59
on:
pull_request:
branches:
- master
name: CodeClimate Workflow
jobs:
codeClimateTrigger:
name: CodeClimate Trigger
runs-on: ubuntu-latest
steps:
- name: Set env vars
id: vars
run: echo "::set-output name=pr_key::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')"
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install npm v8
run: npm install -g npm@8
- name: Check for skipped tests
run: |
[ $(find . -maxdepth 6 -name *.test.ts -exec grep \\.only {} \; | wc -l) -eq 0 ];
- name: Download cc-test-reporter
run: |
mkdir -p tmp/
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
chmod +x ./tmp/cc-test-reporter
- uses: actions/upload-artifact@v3
with:
name: test-reporter
path: ./tmp/cc-test-reporter
- name: Install dependencies
run: npm ci
- name: Link
run: npm run link
- name: Bootstrap
run: npm run bootstrap
- name: Check Diff
run: git diff --exit-code
- name: Lerna checkLicenses
run: npm run checkLicenses
- name: Build
run: npm run build
- name: Lint packages
run: npm run lint
- uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
TEST_SECRETS: ${{secrets.INTEGRATION_TEST_SECRETS}}
TESTMAIL_API_KEY: ${{secrets.TESTMAIL_API_KEY}}
TESTMAIL_NS: ${{secrets.TESTMAIL_NS}}
with:
coverageCommand: npm run test:coverage:codeclimate
- name: Generate and Upload Test Coverage
run: |
$GITHUB_WORKSPACE/tmp/cc-test-reporter sum-coverage $GITHUB_WORKSPACE/tmp/codeclimate.*.json -p $(ls -1q $GITHUB_WORKSPACE/tmp/codeclimate.*.json | wc -l) -d -o tmp/codeclimate.total.json
$GITHUB_WORKSPACE/tmp/cc-test-reporter upload-coverage -i $GITHUB_WORKSPACE/tmp/codeclimate.total.json
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}