Skip to content

Commit 12696e7

Browse files
authored
Merge pull request #127 from codersforcauses/i58-fix_frontend_ci_pipeline
I58 fix frontend ci pipeline
2 parents 1adc2c6 + ae70eda commit 12696e7

4 files changed

Lines changed: 109 additions & 22 deletions

File tree

.github/workflows/backend.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ jobs:
8282
run: |
8383
source .venv/bin/activate
8484
coverage run manage.py test
85-
coverage json
85+
coverage xml
8686
8787
- name: Upload Coverage ☂️
8888
uses: codecov/codecov-action@v3.1.0
8989
with:
9090
flags: backend
91+
files: ./server/coverage.xml

.github/workflows/e2e.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: E2E Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
pull_request:
8+
branches:
9+
- main
10+
- master
11+
12+
jobs:
13+
e2e-tests:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
python-version: [3.10.5]
20+
node: [16]
21+
22+
services:
23+
db:
24+
image: postgres
25+
env:
26+
POSTGRES_USER: postgres
27+
POSTGRES_PASSWORD: postgres
28+
POSTGRES_DB: github-actions
29+
ports:
30+
- 5432:5432
31+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
32+
33+
steps:
34+
- name: Checkout 🛎
35+
uses: actions/checkout@v3
36+
37+
- name: Setup node env 🏗
38+
uses: actions/setup-node@v3.4.1
39+
with:
40+
node-version: ${{ matrix.node }}
41+
check-latest: true
42+
43+
- name: Get yarn cache directory path 🛠
44+
id: yarn-cache-dir-path
45+
run: echo "::set-output name=dir::$(yarn cache dir)"
46+
working-directory: client
47+
48+
- name: Cache node_modules 📦
49+
uses: actions/cache@v3.0.5
50+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
51+
with:
52+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
53+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-yarn-
56+
57+
- name: Install yarn dependencies 👨🏻‍💻
58+
run: yarn
59+
working-directory: client
60+
61+
- name: Setup Python env 🏗
62+
uses: actions/setup-python@v4
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
architecture: x64
66+
67+
- name: Setup Poetry 🏗
68+
uses: snok/install-poetry@v1
69+
with:
70+
version: 1.1.10
71+
virtualenvs-create: true
72+
virtualenvs-in-project: true
73+
74+
- name: Cache .venv 📦
75+
id: cached-poetry-dependencies
76+
uses: actions/cache@v3.0.5
77+
with:
78+
path: server/.venv
79+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
80+
81+
- name: Install Python dependencies 👨🏻‍💻
82+
run: poetry install
83+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
84+
working-directory: server
85+
86+
- name: Run Migrations 🕊️
87+
run: |
88+
source .venv/bin/activate
89+
python manage.py migrate
90+
working-directory: server
91+
92+
- name: Start backend 🚛
93+
run: |
94+
source .venv/bin/activate
95+
python manage.py runserver 0.0.0.0:8081 &
96+
sleep 5 &&
97+
curl http://localhost:8081 -I
98+
working-directory: server
99+
100+
- name: Run Cypress tests 🧪
101+
uses: cypress-io/github-action@v4
102+
with:
103+
working-directory: client
104+
install-command: yarn --frozen-lockfile --silent
105+
build: yarn build
106+
start: yarn start

.github/workflows/frontend.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ jobs:
5959
- name: Run Jest tests 🧪
6060
run: yarn test
6161

62-
- name: Run Cypress tests 🧪
63-
uses: cypress-io/github-action@v4
64-
with:
65-
working-directory: client
66-
install-command: yarn --frozen-lockfile --silent
67-
build: yarn build
68-
6962
- name: Upload Coverage ☂️
7063
uses: codecov/codecov-action@v3.1.0
7164
with:
72-
flags: frontend
65+
flags: frontend

docker-compose.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ services:
2626
# Barrier for OS node modules specific
2727
- /app_code/node_modules
2828

29-
docs:
30-
build:
31-
context: .
32-
dockerfile: docker/docs/Dockerfile
33-
container_name: elucidate_docs
34-
restart: unless-stopped
35-
env_file:
36-
- .env
37-
ports:
38-
- 8000:8000
39-
volumes:
40-
- ./documentation:/documentation
41-
4229
server:
4330
build:
4431
context: .

0 commit comments

Comments
 (0)