This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.48 KB
/
react_app.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
55
56
57
58
59
60
61
62
63
name: ReactAppCI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: bahmutov/npm-install@v1
with:
working-directory: app
- name: Build the Website
working-directory: app
run: npm run build
- name: Run Jest Tests
working-directory: app
run: npm run test -- --coverage --watchAll=false
- name: "Upload to DCSIL App"
working-directory: app
env:
DCSIL_TOKEN: ${{ secrets.DCSIL_TOKEN }}
run: |
# Send the command to the DCSIL App
resp=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: token $DCSIL_TOKEN" -H "X-App-Type: JavaScript" -d @coverage/coverage-summary.json https://dcsil-team-app.herokuapp.com/api/v1/repos/18/code_coverage)
# Output the response from the DCSIL App
echo $resp
# Exit 1 if the response was an error, or if it did not meet requirements (currently a min 65.0%) - CURRENTLY OFF
# exit $(echo $resp | jq 'if .success == false then 1 elif .meets_requirements == false then 1 else 0 end')
# echo "the api is broken"
- name: "Upload to CodeClimate"
working-directory: app
env:
CC_TEST_REPORTER_ID: 1ef6e8adcbf2a45f28e983b08c21a7a64ea73d1451feeae95ce8dc266b7dd2b6
run: |
export GIT_BRANCH="${GITHUB_REF##*/}" # Not set on GitHub Actions
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov # See https://docs.codeclimate.com/docs/configuring-test-coverage for more help
./cc-test-reporter upload-coverage --id $CC_TEST_REPORTER_ID
- name: Install Firebase Tools
run: npm install -g firebase-tools
working-directory: app
- name: Get Git Commit Message
run: |
echo ::set-env name=COMMIT_MSG::$(git log --format=%B -n 1 ${{ github.sha }})
- name: Deploy to firebase
working-directory: app
run: firebase deploy --token $FIREBASE_TOKEN -m "${SHA::8} $COMMIT_MSG"
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
SHA: ${{ github.sha }}