Skip to content

Commit

Permalink
Merge branch 'master' into feature/multimask
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Aug 1, 2024
2 parents c44170e + 0dab52e commit 0ca6716
Show file tree
Hide file tree
Showing 34 changed files with 651 additions and 342 deletions.
6 changes: 6 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "\"v$version\""
version_scheme = "semver2"
version = "1.0.1"
update_changelog_on_bump = true
32 changes: 21 additions & 11 deletions .github/workflows/backend_build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Backend Build
name: Backend Build and Tests
on:
push:
branches:
- master
- fix/build
paths:
- 'backend/**'
- '.github/workflows/backend_build.yml'
- "backend/**"
- ".github/workflows/backend_build.yml"
pull_request:
branches:
- master
paths:
- 'backend/**'
- '.github/workflows/backend_build.yml'
- "backend/**"
- ".github/workflows/backend_build.yml"

jobs:
Build_on_ubuntu:
Expand Down Expand Up @@ -87,6 +86,8 @@ jobs:
run: |
cd backend/
pip install -r requirements.txt
pip install coverage
pip install factory-boy
- name: Creating env
run: |
Expand All @@ -111,22 +112,31 @@ jobs:
pip install numpy
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
- name : Check Opencv version
- name: Check Opencv version
run: |
pip freeze | grep opencv
pip install opencv-python-headless==4.7.0.68
- name: Run tests
- name: Run migrations
env:
TESTING_TOKEN: ${{ secrets.TESTING_TOKEN }}
run: |
cd backend/
export TESTING_TOKEN=$TESTING_TOKEN
python manage.py makemigrations
python manage.py makemigrations core
python manage.py makemigrations login
python manage.py migrate
python manage.py migrate login
python manage.py migrate core
- name : Run tests
env :
TESTING_TOKEN: ${{ secrets.TESTING_TOKEN }}
OSM_CLIENT_ID: ${{ secrets.OSM_CLIENT_ID }}
OSM_CLIENT_SECRET: ${{ secrets.OSM_CLIENT_SECRET }}
OSM_SECRET_KEY: ""

run : |
cd backend/
coverage run manage.py test tests
coverage report
8 changes: 5 additions & 3 deletions .github/workflows/docker_publish_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
branches:
- master
paths-ignore:
- '.github/workflows/backend_build.yml'
- '.github/workflows/frontend_build.yml'
- '.github/workflows/frontend_build_push.yml'
- ".github/workflows/backend_build.yml"
- ".github/workflows/frontend_build.yml"
- ".github/workflows/frontend_build_push.yml"
release:
types: [released]

env:
REGISTRY: ghcr.io
Expand Down
50 changes: 24 additions & 26 deletions .github/workflows/frontend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,41 @@ name: Frontend Build

on:
push:
branches: [ master ]
branches: [master]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build.yml'
- "frontend/**"
- ".github/workflows/frontend_build.yml"
pull_request:
branches: [ master ]
branches: [master]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build.yml'
- "frontend/**"
- ".github/workflows/frontend_build.yml"

jobs:
Build_On_Ubuntu:

runs-on: ubuntu-latest
env:
CI: false

strategy:
matrix:
node-version: [ 16.14.2, 16, 18, 20 ]
node-version: [16, 18, 20]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
cd frontend/
npm install --legacy-peer-deps
- name: Build
run: |
cd frontend/
npm run build
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
cd frontend/
npm install --legacy-peer-deps
- name: Build
run: |
cd frontend/
npm run build
64 changes: 29 additions & 35 deletions .github/workflows/frontend_build_push.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
name: Frontend Build and upload to S3

on:
push:
branches: [ master ]
release:
types: [released]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build_push.yml'
pull_request:
branches: [ master ]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build_push.yml'
- "frontend/**"
- ".github/workflows/frontend_build_push.yml"

permissions:
id-token: write
contents: read

jobs:
build_and_upload:

runs-on: ubuntu-latest
environment: Production
env:
CI: false

strategy:
matrix:
node-version: [ 16 ]
node-version: [16.14.2]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: cd frontend/ && npm install --legacy-peer-deps

- name: Build frontend
run: cd frontend/ && npm run build
env:
REACT_APP_API_BASE: ${{ vars.REACT_APP_API_BASE }}
REACT_APP_PREDICTOR_API_BASE: ${{ vars.REACT_APP_PREDICTOR_API_BASE }}
REACT_APP_ENV: Dev

- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: fAIrGithub

- name: Upload to S3
run: cd frontend/build && aws s3 sync . s3://${{ vars.FRONTEND_BUCKET }}/
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: cd frontend/ && npm install --legacy-peer-deps

- name: Build frontend
run: cd frontend/ && npm run build
env:
REACT_APP_API_BASE: ${{ vars.REACT_APP_API_BASE }}
REACT_APP_PREDICTOR_API_BASE: ${{ vars.REACT_APP_PREDICTOR_API_BASE }}
REACT_APP_ENV: Dev

- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: fAIrGithub

- name: Upload to S3
run: cd frontend/build && aws s3 sync . s3://${{ vars.FRONTEND_BUCKET }}/
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## "v1.0.0" (2024-05-30)

### BREAKING CHANGE

- first public release

### Feat

- **commitzen**: adds commitizen for release strategy

### Fix

- image fix

## v0.1.0 (2024-05-30)

## v0.0.1 (2022-12-22)
Binary file added backend/.DS_Store
Binary file not shown.
Loading

0 comments on commit 0ca6716

Please sign in to comment.