Skip to content
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f79a76a
Create unittest.yml
hyihua Nov 19, 2023
750f12f
changed python3.8 -> 3
qchiujunhao Nov 19, 2023
4e71487
removed the action for push
qchiujunhao Nov 19, 2023
1329aca
rectify the name of the docker image
hyihua Nov 19, 2023
fc528e5
Correct the python version
hyihua Nov 19, 2023
f682233
set up the step to run docker container
hyihua Nov 19, 2023
07212e9
change the docker image name.
hyihua Nov 19, 2023
9be8c22
correct typo
hyihua Nov 19, 2023
c783e5b
javascript unittest
qchiujunhao Nov 19, 2023
e57637e
update commands for running tests using docker-compose
hyihua Nov 23, 2023
676043d
run commands without using docker
hyihua Nov 24, 2023
9a76cd1
generate .env file for using docker-compose
hyihua Nov 24, 2023
85822b9
print docker compose log for debugging
hyihua Dec 2, 2023
37c3769
add a service `test` in docker-compose.yml
hyihua Dec 2, 2023
febe27a
update the service `test` in docker-compose.yml
hyihua Dec 2, 2023
ac15ae5
remove the steps for js test for debugging
hyihua Dec 2, 2023
b0af506
Create unittest_without_docker.yml
hyihua Dec 3, 2023
40e8b69
remove unittest_without_docker.yml
hyihua Dec 3, 2023
5213e8c
correct typo
hyihua Dec 3, 2023
0cdb69e
update unittest.yml by executing tests inside the docker container
hyihua Dec 10, 2023
487bf5d
deleted the test service
qchiujunhao Dec 10, 2023
c00db0c
add "-T" flag to avoid "not TTY" error.
hyihua Dec 10, 2023
14a9616
commented python unittest for testing other actions
qchiujunhao Dec 10, 2023
ec06d1b
Update unittest.yml
qchiujunhao Dec 10, 2023
9d31673
uncommented python unittest
qchiujunhao Dec 10, 2023
6be4d83
Revert "changed python3.8 -> 3"
hyihua Dec 10, 2023
d6c7090
add comment for flag "-T"
hyihua Dec 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit Test
on:
pull_request:
paths:
- '**/*.py'
- '**/*.js'
- '.github/workflows/unittest.yml'

jobs:
Run-Unit-Test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Get env File
run: cp ./example.env ./.env

- name: Build and run Docker containers
run: docker-compose -f docker-compose.yml up --build --detach

# adding the "-T" flag to tell the docker to run the command without allocating a TTY (interact with a terminal).
- name: Run Python tests
run: docker-compose -f docker-compose.yml exec -T web python manage.py test

- name: Run JavaScript Tests
run: docker-compose -f docker-compose.yml exec -T web npm run test

- name: Stop and remove containers
run: docker-compose -f docker-compose.yml down

- name: Remove Copied Env file
run: rm ./.env