-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add devcontainer config Signed-off-by: Aakash Singh <mail@singhaakash.dev> * add devcontainer config Signed-off-by: Aakash Singh <mail@singhaakash.dev> * switch to pipenv * fix tests * remove test workflow restriction * fix concurrency issue * update deploy workflow * revert removed step --------- Signed-off-by: Aakash Singh <mail@singhaakash.dev>
- Loading branch information
Showing
41 changed files
with
3,002 additions
and
544 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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.venv | ||
.git | ||
htmlcov | ||
staticfiles | ||
.coverage |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
source .venv/bin/activate; unset PS1 | ||
layout pipenv | ||
dotenv |
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
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
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
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,36 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Bake docker images | ||
uses: docker/bake-action@v3.1.0 | ||
with: | ||
load: true | ||
builder: ${{ steps.buildx.outputs.name }} | ||
set: | | ||
*.cache-from=type=gha,scope=cached-stage | ||
*.cache-to=type=gha,scope=cached-stage,mode=max | ||
files: docker-compose.yaml,docker-compose.local.yaml | ||
|
||
- name: Start services | ||
run: docker compose -f docker-compose.yaml -f docker-compose.local.yaml up -d --no-build | ||
|
||
- name: Check migrations | ||
run: make checkmigration | ||
|
||
- name: Run tests | ||
run: make test-coverage | ||
|
||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v3 |
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 |
---|---|---|
@@ -1,77 +1,12 @@ | ||
name: Test | ||
name: Test Pull Request | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
if: github.repository == 'coronasafe/care' | ||
runs-on: ubuntu-latest | ||
env: | ||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/care | ||
services: | ||
db: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: care | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
redis: | ||
image: redis:alpine | ||
ports: | ||
- 6379:6379 | ||
localstack: | ||
image: localstack/localstack:latest | ||
env: | ||
AWS_DEFAULT_REGION: ap-south-1 | ||
EDGE_PORT: 4566 | ||
SERVICES: s3 | ||
ports: | ||
- 4566:4566 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- name: Install system packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install binutils libproj-dev libjpeg-dev zlib1g-dev -y | ||
- name: Install CI dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements/local.txt | ||
- name: Check for missing migrations | ||
run: | | ||
python manage.py makemigrations --check --dry-run --noinput | ||
- name: Configure environment | ||
run: | | ||
echo "JWKS_BASE64=$(python manage.py generate_jwks)" >> $GITHUB_ENV | ||
- name: Run Tests with coverage | ||
run: coverage run manage.py test --settings=config.settings.test --parallel=$(nproc) | ||
|
||
- name: Generate coverage report | ||
run: | | ||
coverage combine || true | ||
coverage xml | ||
coverage report -m | ||
uses: ./.github/workflows/test-base.yml |
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 |
---|---|---|
|
@@ -324,7 +324,6 @@ tags | |
[Ii]nclude | ||
[Ll]ib | ||
[Ll]ib64 | ||
[Ss]cripts | ||
pyvenv.cfg | ||
pip-selfcheck.json | ||
.env | ||
|
Oops, something went wrong.