Skip to content

Commit f42694b

Browse files
authored
Merge pull request #5 from 2024-dissertation/develop
v1.0.2
2 parents 7281cc1 + 47c7c95 commit f42694b

93 files changed

Lines changed: 358 additions & 496 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Model Maker CI
2+
# credit: https://github.com/pressly/goose/blob/main/.github/workflows/ci.yaml
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
pull_request:
10+
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
test:
22+
name: Run unit tests
23+
timeout-minutes: 10
24+
25+
runs-on: ubuntu-latest
26+
27+
services:
28+
postgres:
29+
image: postgres:15
30+
ports:
31+
- 5432:5432
32+
env:
33+
POSTGRES_USER: postgres
34+
POSTGRES_PASSWORD: changeme
35+
POSTGRES_DB: appdb_test
36+
options: >-
37+
--health-cmd="pg_isready -U postgres -d appdb_test"
38+
--health-interval=10s
39+
--health-timeout=5s
40+
--health-retries=5
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
- name: Install Go
46+
uses: actions/setup-go@v5.4.0
47+
- name: Install Go Tools
48+
run: |
49+
go install github.com/joho/godotenv/cmd/godotenv@latest && \
50+
go install github.com/nikolaydubina/go-cover-treemap@latest
51+
- name: Wait for PostgreSQL to be ready
52+
run: |
53+
for i in {1..10}; do
54+
if pg_isready -h localhost -p 5432 -U testuser -d testdb; then
55+
echo "PostgreSQL is ready"
56+
break
57+
fi
58+
echo "Waiting for PostgreSQL..."
59+
sleep 5
60+
done
61+
- name: Check Go code formatting
62+
run: |
63+
cd app
64+
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
65+
gofmt -s -l .
66+
echo "Please format Go code by running: go fmt ./..."
67+
exit 1
68+
fi
69+
- name: Install tparse
70+
run: go install github.com/mfridman/tparse@main
71+
- name: Run tests
72+
env:
73+
DB_HOST: localhost
74+
DB_NAME: appdb_test
75+
DB_PORT: 5432
76+
DB_USER: postgres
77+
DB_PASSWORD: changeme
78+
DB_TIMEZONE: UTC
79+
run: |
80+
cd app
81+
mkdir build
82+
go vet ./...
83+
go build ./...
84+
make test

.github/workflows/gorelease.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ jobs:
2525
distribution: goreleaser
2626
version: "~> v2"
2727
args: release --clean --release-notes=${{runner.temp}}/release_notes.txt
28+
workdir: app
2829
env:
2930
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"editor.formatOnSave": true
2+
"editor.formatOnSave": true,
3+
"notebook.formatOnSave.enabled": true
34
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
### [v1.0.2]
11+
12+
- Added Job Queue for the photogrammetry process. Max of 1 at a time
13+
- Max 100 jobs in the queue
14+
- Added Queued status to Tasks
15+
1016
### [v1.0.0]
1117

1218
- Initial stable release. Production ready.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img align="right" width="125" src="assets/app-icon.png">
44

5-
[![Go Tests](https://github.com/2024-dissertation/go-api/actions/workflows/test.yml/badge.svg)](https://github.com/2024-dissertation/go-api/actions/workflows/test.yml)
5+
[![Model Maker CI](https://github.com/2024-dissertation/model-maker-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/2024-dissertation/model-maker-docker/actions/workflows/ci.yml)
66

77
Model Maker is an accessible and Open Source solution to Photogrammetry. This is the backend for the also open source [Flutter App](https://github.com/2024-dissertation/model-maker-app).
88

app/.DS_Store

-10 KB
Binary file not shown.

app/.env.github

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

app/.github/workflows/test.yml

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

app/Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.DEFAULT_GOAL := build-and-run
22

3-
BIN_FILE=main.out
3+
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=5m -json
44

5-
PKGS := github.com/Soup666/diss-api/cmd/vision,github.com/Soup666/diss-api/database,github.com/Soup666/diss-api/docs,github.com/Soup666/diss-api/middleware,github.com/Soup666/diss-api/middleware_test,github.com/Soup666/diss-api/model,github.com/Soup666/diss-api/repository,github.com/Soup666/diss-api/router,github.com/Soup666/diss-api/seed,github.com/Soup666/diss-api/seeder,github.com/Soup666/diss-api/seeds,github.com/Soup666/diss-api/utils
5+
BIN_FILE=main.out
66

77
build-and-run: build run
88

@@ -23,14 +23,13 @@ run:
2323
./"${BIN_FILE}"
2424

2525
test:
26-
@godotenv -f .env.test go test ./... -cover fmt
27-
28-
test-cover:
2926
echo "Running tests with coverage..."
30-
@echo "${COVERPKG}"
31-
@godotenv -f .env.test go test -coverprofile=cp.out -coverpkg=$(PKGS) ./...
32-
@go tool cover -html=cp.out -o cover.html
33-
@go-cover-treemap -coverprofile=cp.out > out.svg
27+
@command -v tparse >/dev/null 2>&1 || go install github.com/mfridman/tparse@latest
28+
@command -v go-cover-treemap >/dev/null 2>&1 || go install github.com/nikolaydubina/go-cover-treemap@latest
29+
go test $(GO_TEST_FLAGS) -coverprofile=cp.out -coverpkg=$$(go list ./... | grep -v -e /bin -e /cmd -e /examples) ./... |\
30+
tparse --follow -sort=elapsed -trimpath=auto -all
31+
go tool cover -html=cp.out -o cover.html
32+
go-cover-treemap -coverprofile=cp.out > out.svg
3433

3534
doc:
3635
swag init

app/cmd/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)