Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging updated #769

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": ["next/core-web-vitals", "plugin:react/recommended", "prettier"],
"extends": [
"next/core-web-vitals",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"custom-rules/no-text-size-class": "warn"
"custom-rules/no-text-size-class": "warn",
"prettier/prettier": "error"
},
"plugins": ["react", "eslint-plugin-custom-rules"],
"plugins": [
"react",
"eslint-plugin-custom-rules",
"@typescript-eslint",
"prettier"
],
"settings": {
"react": {
"version": "detect"
Expand Down
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/data"
schedule:
interval: "weekly"
51 changes: 32 additions & 19 deletions .github/workflows/pr_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
name: Frontend PR Checks
on: # see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
workflow_dispatch:
pull_request:
paths:
- "src/**/*"
- "package.json"
- "package-lock.json"
- "*.js"
name: PR Checks

on:
push:
branches:
- staging

jobs:
lint_and_build:
lint:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "package-lock.json"
node-version: '20'

- name: Install dependencies
run: npm ci
- name: Run lints
run: npm install

- name: Run ESLint
run: npm run lint
- name: Check the build
run: npm run build
continue-on-error: true

- name: Run Prettier Check
run: npm run format:check
continue-on-error: true

- name: Check linting and formatting
if: failure()
run: |
echo "Linting or formatting issues found. Please run 'npm run lint:fix' and 'npm run format' to fix them."
exit 1

- name: Linting and formatting success
if: success()
run: echo "No linting or formatting issues found. Good job!"
81 changes: 81 additions & 0 deletions .github/workflows/pr_checks_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PR Checks Backend

on:
pull_request:
branches:
- staging
paths:
- "data/**"
- "Dockerfile-pg"
- "init_pg.sql"
- "docker-compose.yml"

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up Docker Compose
uses: docker/setup-qemu-action@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11.4"

- name: Run Black Formatter in Docker
run: |
cd data
docker-compose run --rm formatter
continue-on-error: true

- name: Run Flake8
run: |
cd data
pip install flake8
flake8 .
continue-on-error: true

- name: Install dependencies and build Docker images
run: |
cd data
docker-compose pull
docker-compose build

- name: Run vacant-lots-proj
run: |
cd data
docker-compose up -d vacant-lots-proj
continue-on-error: true

- name: Build and check Postgres container
run: |
cd data
docker-compose build postgres
continue-on-error: true

- name: Check build status
if: failure()
run: |
echo "The vacant-lots-proj or postgres container failed to build and run."
exit 1

- name: Report success
if: success()
run: echo "The vacant-lots-proj and postgres container built and ran successfully."

- name: Check formatter and linter status
if: failure()
run: |
echo "Formatting or linting issues found. Please fix the issues."
exit 1

- name: Formatter and linter success
if: success()
run: echo "Formatting and linting passed successfully."
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
}
14 changes: 11 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"python.analysis.extraPaths": ["${workspaceFolder}/data/src","${workspaceFolder}/data/src/awkde"],
"python.analysis.extraPaths": [
"${workspaceFolder}/data/src",
"${workspaceFolder}/data/src/awkde"
],
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}/data/src",
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
"source.organizeImports": "explicit"
},
}
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.linting.flake8Args": ["--max-line-length=88"]
}
3 changes: 3 additions & 0 deletions data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ ENV GDAL_CONFIG=/usr/bin/gdal-config
# Install Pipenv
RUN pip install pipenv

# update pipfile
RUN pipenv lock

# Copy the Pipfile and Pipfile.lock from the src directory
COPY src/Pipfile src/Pipfile.lock ./

Expand Down
Loading
Loading