Skip to content

Commit 93c6c3b

Browse files
committed
updating cicd.md
1 parent 9e453b6 commit 93c6c3b

File tree

2 files changed

+52
-34
lines changed

2 files changed

+52
-34
lines changed

docs/CICD.md

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,77 @@
22

33
## 🏋️‍♀️Let's add this code to our CI system.
44

5-
1. Create a `charity.ci.yml` file in this folder structure `.github/workflows/` in the root of your directory
6-
2. Paste in the following configuration
5+
1. In the repository's Github, go to `Actions` tab
6+
2. Configure `Node.js`
7+
3. Keep the name of the file and on line 4, or change, up to you
8+
4. Paste in the following configuration
79

810
```yml
9-
name: Testing for Charity
11+
name: Comprehensive Testing
12+
env:
13+
SCREENER_API_KEY: ${{ secrets.SCREENER_API_KEY }}
14+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
15+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
1016

1117
on:
1218
push:
13-
branches: [ main ]
19+
# Only trigger if files in this path changed
20+
paths:
21+
- 'tado-sec/my-react-app/**'
22+
- '.github/workflows/tado.sec.yml'
23+
# Don't run on Markdown changes
24+
- '!**.md'
25+
branches: [main]
1426
pull_request:
15-
branches: [ main ]
27+
# Only trigger if files in this path changed
28+
paths:
29+
- 'tado-sec/my-react-app/**'
30+
- '.github/workflows/tado.sec.yml'
31+
# Don't run on Markdown changes
32+
- '!**.md'
33+
branches: [main]
1634

1735
jobs:
1836
build:
19-
2037
runs-on: ubuntu-latest
2138

2239
strategy:
2340
matrix:
24-
node-version: [14.x]
41+
node-version: [16.x]
2542

2643
steps:
27-
- uses: actions/checkout@v2
28-
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v1
30-
with:
31-
node-version: ${{ matrix.node-version }}
32-
- name: Install dependencies 📦
33-
#Using npm ci is generally faster than running npm install
34-
run: |
35-
cd testing-for-charity/my-react-app
36-
npm ci
37-
- name: Build the app 🏗
38-
run: |
39-
cd testing-for-charity/my-react-app
40-
npm run build
41-
# If we had more time, at this point we can actually deploy our app
42-
# to a staging server and then run functional tests
43-
- name: Start the app 📤
44-
run: |
45-
cd testing-for-charity/my-react-app
46-
npm start &
47-
npx wait-on --timeout 60000
48-
- name: Run functional UI tests 🖥
49-
run: |
50-
cd testing-for-charity/my-react-app
51-
npm run cy:ci
44+
- uses: actions/checkout@v2
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v1
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
- name: Install dependencies 📦
50+
#Using npm ci is generally faster than running npm install
51+
run: |
52+
npm ci
53+
- name: Build the app 🏗
54+
run: |
55+
npm run build
56+
# If we had more time, at this point we can actually deploy our app
57+
# to a staging server and then run functional tests
58+
- name: Start the app 📤
59+
run: |
60+
npm start &
61+
npx wait-on --timeout 60000
62+
- name: Run functional UI tests 🖥
63+
run: |
64+
npm run cy:ci
65+
- name: Run visual tests 👁
66+
run: |
67+
npm run test:visual
5268
```
69+
5370
3. Add New repository secrets for the repo
5471
5572
![adding secrets](../../../graphics/secrets.png)
5673
57-
4. `git push` and watch it run
74+
1. Commit the new file
75+
2. `git push` all of your changes to your repo
5876

5977
## 🧪Current Test Coverage
6078

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test": "react-scripts test",
1414
"eject": "react-scripts eject",
1515
"cy:open": "cypress open",
16-
"cy:ci": "cypress run",
16+
"cy:ci": "cypress run --spec **/*solution.spec.js",
1717
"test:sanity:us": "wdio run ./wdio.visual.conf.js",
1818
"test:sanity:eu": "REGION=eu npx wdio run ./wdio.sanity.conf.js",
1919
"test:visual": "wdio run ./wdio.visual.conf.js",

0 commit comments

Comments
 (0)