This repository was archived by the owner on May 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
80 lines (68 loc) · 2.8 KB
/
nodejs.yml
File metadata and controls
80 lines (68 loc) · 2.8 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Unit tests and uploading test coverage
on:
pull_request:
branches: [master]
paths:
- web
jobs:
yarn:
env:
FILE_COUNTER: 0
CC_TEST_REPORTER_ID: 3512ac105b5e332e8450e1c0c4003a78d07f3c52ab7520d1b0b6fac233996730
ACTION_DEBUG: true
CI: true
GITHUB_TOKEN: ${{secrets.GITHUB_API_TOKEN}}
EVENT_BRITE_API_KEY: ${{secrets.EVENT_BRITE_API_KEY}}
GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}}
GATSBY_ALGOLIA_SEARCH_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_KEY}}
GATSBY_ACTIVE_ENV: "test"
name: Create, format and upload Javascript coverage artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Get Code Climate binary
- name: Download Code Climate Binary
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# Permissions applied to the Code Climate Executable
- name: Apply executable perms to Code Climate Binary
run: chmod +x ./cc-test-reporter
# Before build
- name: Before build
run: ./cc-test-reporter before-build
# Set required Git env vars for either pull request
- name: Set ENV for codeclimate (pull_request)
run: |
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
# Set required Git env vars for a push to master
- name: Set ENV for codeclimate (push)
run: |
echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
if: github.event_name == 'push'
# Trimming the ref to master in order to publish correct report (paambaati)
- name: Set ref/head/master to master
run: |
echo "GIT_BRANCH=master" >> $GITHUB_ENV
if: env.GIT_BRANCH == 'refs/heads/master'
# Install Modules - Devhub Front-End
- name: npm install, lint and test
run: |
cd web
npm i
npm run test:lint
npm run test -- --coverage
# Formatting the FRONTEND coverage report
- name: Format the FRONTEND coverage report
run: |
./cc-test-reporter format-coverage -t lcov -o coverage/index.html ${{github.workspace}}/web/coverage/lcov.info
# Upload File for debugging purposes
- name: Upload File for debugging purposes
uses: actions/upload-artifact@v2
with:
name: summed-yarn-coverage-report
path: coverage/index.html
# Upload total coverage report to Code Climate
- name: Upload coverage report to Code Climate
run: ./cc-test-reporter upload-coverage -i coverage/index.html