diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..5547e82
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,82 @@
+name: CI/CD
+
+on:
+ pull_request_target:
+ branches:
+ - '**'
+
+jobs:
+ backend-checks:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: hackathon_site
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: ${{github.event.pull_request.head.ref}}
+ repository: ${{github.event.pull_request.head.repo.full_name}}
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v1
+ with:
+ python-version: 3.8
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ - name: Check formatting with Black
+ run: |
+ # Stop the build if there are any formatting issues picked up by Black
+ black --check .
+ - name: Tests
+ env:
+ SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
+ DEBUG: 0
+ run: python manage.py test --settings=hackathon_site.settings.ci
+
+ template-checks:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: hackathon_site
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: ${{github.event.pull_request.head.ref}}
+ repository: ${{github.event.pull_request.head.repo.full_name}}
+ - name: Use Node.js 12.x
+ uses: actions/setup-node@v1
+ with:
+ node-version: '12.x'
+ - name: Install dependencies
+ run: yarn install
+ - name: Formatting check
+ run: yarn run prettier-check
+
+ dashboard-checks:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: hackathon_site/dashboard/frontend
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: ${{github.event.pull_request.head.ref}}
+ repository: ${{github.event.pull_request.head.repo.full_name}}
+ - name: Use Node.js 12.x
+ uses: actions/setup-node@v1
+ with:
+ node-version: '12.x'
+ - name: Install dependencies
+ run: yarn install
+ - name: Formatting check
+ run: yarn prettier --check 'src/**/*.(js|ts|tsx|scss)'
+ - name: Typescript check
+ run: yarn run tsc
+ - name: Tests
+ run: yarn test --watchAll=false
+ - name: Build frontend
+ run: yarn run build
diff --git a/deployment/entrypoint.sh b/deployment/entrypoint.sh
index 2f33e35..704de48 100644
--- a/deployment/entrypoint.sh
+++ b/deployment/entrypoint.sh
@@ -18,4 +18,4 @@ then
else
echo "Failed to connect to database"
exit 1
-fi
\ No newline at end of file
+fi
diff --git a/hackathon_site/dashboard/frontend/src/api/helpers.ts b/hackathon_site/dashboard/frontend/src/api/helpers.ts
index 70f0067..53836f5 100644
--- a/hackathon_site/dashboard/frontend/src/api/helpers.ts
+++ b/hackathon_site/dashboard/frontend/src/api/helpers.ts
@@ -72,7 +72,6 @@ export const teamOrderListSerialization = (
id: order.id,
hardwareInOrder: returnedHardware,
});
-
const hardwareInTableRow = Object.values(hardwareItems);
if (hardwareInTableRow.length > 0)
(order.status === "Submitted" || order.status === "Ready for Pickup"
diff --git a/hackathon_site/dashboard/frontend/src/components/dashboard/ItemTable/ItemTable.test.tsx b/hackathon_site/dashboard/frontend/src/components/dashboard/ItemTable/ItemTable.test.tsx
index 3b15219..2f031e2 100644
--- a/hackathon_site/dashboard/frontend/src/components/dashboard/ItemTable/ItemTable.test.tsx
+++ b/hackathon_site/dashboard/frontend/src/components/dashboard/ItemTable/ItemTable.test.tsx
@@ -14,7 +14,7 @@ import {
mockReturnedOrdersInTable,
} from "testing/mockData";
import { ReturnOrderInTable } from "api/types";
-import { getAllByText } from "@testing-library/react";
+import { getAllByText, queryAllByText } from "@testing-library/react";
describe("
Event | +Time | +Sign In Interval | +Scanned | +
---|---|---|---|
{{ event.description }} | +{{ event.time.strftime("%H:%M, %b %d") }} | +{{ get_sign_in_interval(event.time) }} | +{{ sign_in_counts[event.name] }} | +