Skip to content

Commit

Permalink
Start using docker for backend test thjing
Browse files Browse the repository at this point in the history
  • Loading branch information
jcallison1 committed Sep 27, 2024
1 parent dca9b25 commit 972c5c7
Showing 1 changed file with 30 additions and 47 deletions.
77 changes: 30 additions & 47 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,45 @@ name: Run Tests
on: [push, pull_request]

jobs:
# TODO: Set up backend tests
# backend-test:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4

# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: "3.12"

# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: "22.x"

# - name: Install Python dependencies
# run: |
# python -m pip install -U pip
# pip install -U -r BackEndFlask/requirements.txt

frontend-test:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"

- name: Install Python dependencies
run: |
python -m pip install -U pip
pip install -U -r BackEndFlask/requirements.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Start backend
run: |
cd BackEndFlask
python setupEnv.py -d
python setupEnv.py -s &
for attempt in {1..20}; do sleep 1; if curl 'http://localhost:5050/api'; then echo ready; break; fi; echo waiting...; done
- name: Install Node dependencies
run: |
cd FrontEndReact
npm install
- name: Build and push
uses: docker/bake-action@v5
with:
targets: ["backend"]
push: false
load: true

- name: Run Jest tests
- name: Start backend
run: |
cd FrontEndReact
npm test
docker compose run -d backend
# - name: Start backend
# run: |
# cd BackEndFlask
# python setupEnv.py -d
# python setupEnv.py -s &
# for attempt in {1..20}; do sleep 1; if curl 'http://localhost:5050/api'; then echo ready; break; fi; echo waiting...; done

# - name: Install Node dependencies
# run: |
# cd FrontEndReact
# npm install

# - name: Run Jest tests
# run: |
# cd FrontEndReact
# npm test

0 comments on commit 972c5c7

Please sign in to comment.