forked from GhostManager/Ghostwriter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7ad9c5
commit f386fef
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Run Unit Test Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build environment | ||
run: | | ||
mkdir .envs && cp -r .envs_template/.* .envs | ||
docker-compose -f local.yml up --build -d | ||
- name: Test seeding database | ||
run: docker-compose -f local.yml run --rm django /seed_data | ||
|
||
- name: Generate coverage report | ||
run: | | ||
docker-compose -f local.yml run django coverage run manage.py test | ||
docker-compose -f local.yml run django coverage xml -o "coverage/reports/coverage.xml" | ||
- name: Upload coverage report to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: coverage/reports/ | ||
files: coverage.xml | ||
name: codecov-ghostwriter | ||
fail_ci_if_error: true | ||
verbose: true |