Skip to content

Commit

Permalink
Merge pull request #42 from COS301-SE-2024/v0.0.1
Browse files Browse the repository at this point in the history
v0.0.1
  • Loading branch information
Rethakgetse-Manaka authored Jun 3, 2024
2 parents b3a12da + abc3f57 commit e043757
Show file tree
Hide file tree
Showing 452 changed files with 104,330 additions and 16,111 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ If applicable, add logs that you may have gathered as well.
- Node version [e.g. 18, 20]
- npm version [e.g. 10]
- App version [e.g. 0.2.0(can usually be found in the <a href="">package.json</a> file, first line)]
NB: The above is optional if it's applicable and as such may be removed if it's not useful

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/task_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Task
about: Create a task to be implemented
title: "[TASK]"
labels: task
---

**Task Request**

- [ ] Task 1
- [ ] Task 2
- [ ] Task 3
- [ ] Task n

<tag_user_here>, please tick off as you complete each task by clicking on the task you are done with in this comment

**Additional info**
Any additional info, articles that you think may help the developer should be added here.
57 changes: 37 additions & 20 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
name: Build and Deploy docs to GitHub Pages
name: Deploy Docs site to Pages

on:
push:
branches: [ master ]
paths:
- "documentation/ocp-live-docs/**"
push:
branches: ["develop"]
paths: [
"documentation/occupi-docs/pages/**",
"documentation/occupi-docs/components/**",
"documentation/occupi-docs/.gitignore",
"documentation/occupi-docs/next.config.js",
"documentation/occupi-docs/package.json",
"documentation/occupi-docs/theme.config.tsx",
"documentation/occupi-docs/tsconfig.json"
]

workflow_dispatch:
workflow_dispatch:

defaults:
run:
working-directory: documentation/ocp-live-docs
working-directory: documentation/occupi-docs

jobs:
# Build job
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
node-version: 18
bun-version: latest # or "latest", "canary", <sha>

- name: Install dependencies
run: npm ci

- name: Build website
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next

- name: Install dependencies with Bun
run: bun install

- name: Build with Next.js
run: bun run build

- name: Upload Build Artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: documentation/ocp-live-docs/build
path: documentation/occupi-docs/out

# Deployment job
deploy:
name: Deploy to GitHub Pages
needs: build
Expand All @@ -54,4 +71,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
42 changes: 42 additions & 0 deletions .github/workflows/deploy-landing-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Landing page

on:
push:
branches: ["not-yet-specified"]

workflow_dispatch:

defaults:
run:
working-directory: frontend/occupi

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>

- name: Install dependencies
run: bun install

- name: Build Next.js app
run: bun run build

- name: Export static files (if needed)
run: bun export

- name: Add SSH key
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Deploy to server
run: |
rsync -avz --delete-after frontend/occupi/out ${{ secrets.DEPLOY_SERVER }}:${{ secrets.DEPLOY_PATH }}
79 changes: 79 additions & 0 deletions .github/workflows/lint-test-build-golang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Lint, Test and Build golang

on:
pull_request:
branches: ["develop"]
paths: [
"occupi-backend/cmd/**",
"occupi-backend/configs/**",
"occupi-backend/pkg/**",
"occupi-backend/.golangci.yml",
"occupi-backend/tests/**",
]

workflow_dispatch:

defaults:
run:
working-directory: occupi-backend

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21' # Specify the Go version you are using

- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run golangci-lint
run: |
golangci-lint run
test:
name: Test
runs-on: ubuntu-latest

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21' # Specify the Go version you are using

- name: Run tests
run: |
go test ./tests/... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build
runs-on: ubuntu-latest

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21' # Specify the Go version you are using

- name: Build the code
run: |
go build -v cmd/occupi-backend/main.go
63 changes: 63 additions & 0 deletions .github/workflows/lint-test-build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Lint, Test, Build Web

on:
pull_request:
branches: ["develop"]
paths: [
"frontend/occupi-web/**",
]

workflow_dispatch:

defaults:
run:
working-directory: frontend/occupi-web

jobs:
# Lint job
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>

- name: Lint with ESLint
run: bun run lint

# Test job
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>

- name: Test with Jest
run: bun run test

# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>

- name: Install dependencies with Bun
run: bun install

- name: Build with Next.js
run: bun run build
33 changes: 0 additions & 33 deletions .github/workflows/test-docs-deploy.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/test-mobile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Mobile

on:
pull_request:
branches:
- develop
paths: [
"frontend/occupi-mobile3/**"
]

workflow_dispatch:

defaults:
run:
working-directory: frontend/occupi-mobile3

jobs:
test:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Dependencies
run: npm install --legacy-peer-deps

- name: Run Tests
run: npm run test-ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading

0 comments on commit e043757

Please sign in to comment.