Skip to content

Commit 05a39b6

Browse files
committed
cleaned up and implemented a basic integration test
1 parent 12bfb58 commit 05a39b6

File tree

5 files changed

+107
-70
lines changed

5 files changed

+107
-70
lines changed

.github/workflows/build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ "development", "master" ]
6+
pull_request:
7+
branches: [ "development", "master" ]
8+
9+
jobs:
10+
build_frontend:
11+
defaults:
12+
run:
13+
working-directory: ./frontend/
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Use Node.js 18.X
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: "18.x"
21+
cache: 'npm'
22+
cache-dependency-path: 'frontend/package-lock.json'
23+
- run: npm install
24+
- run: npm run build --if-present
25+
26+
build_backend:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v3
33+
with:
34+
go-version: 1.20.2
35+
36+
- name: Linting
37+
uses: golangci/golangci-lint-action@v3
38+
with:
39+
version: v1.53.3
40+
working-directory: ./backend
41+
args: --verbose
42+
43+
- name: Build
44+
run: |
45+
cd backend/
46+
go build -v
47+
48+
- name: Test
49+
run: |
50+
cd backend/
51+
go test -coverprofile=coverage.txt ./...
52+
53+
- name: Upload coverage reports to Codecov
54+
uses: codecov/codecov-action@v3
55+
with:
56+
files: /backend/coverage.txt
57+
verbose: true
58+
token: ${{ secrets.CODECOV_TOKEN }}
59+
60+
build_tool:
61+
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
python-version: ["3.10"]
65+
steps:
66+
- uses: actions/checkout@v3
67+
- name: Set up Python ${{ matrix.python-version }}
68+
uses: actions/setup-python@v3
69+
with:
70+
python-version: ${{ matrix.python-version }}
71+
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install pylint
76+
77+
- name: Analysing the code with pylint
78+
run: |
79+
pylint $(git ls-files python_tools/'*.py') --fail-under=8

.github/workflows/go.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/integration.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Integration Test
2+
3+
on:
4+
push:
5+
branches: ["development"]
6+
pull_request:
7+
branches: ["development"]
8+
9+
jobs:
10+
integration:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v3
17+
with:
18+
go-version: 1.20.2
19+
20+
- name: Build & Run
21+
run: |
22+
cd backend/
23+
go build -o backend
24+
./backend local &
25+
cd ../frontend/
26+
npm install
27+
npm run test

.github/workflows/node.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

backend/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func CacheMeOutsideHowBoutDat() {
7474
func main() {
7575
apiServer := buildServer()
7676
go CacheMeOutsideHowBoutDat()
77-
err := apiServer.Run("backend:8080") // listen and serve on
77+
err := apiServer.Run() // listen and serve on
7878
if err != nil {
7979
log.Fatal("Failed to run server")
8080
}

0 commit comments

Comments
 (0)