-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from hbomb79/testing
- Loading branch information
Showing
71 changed files
with
4,804 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests/ | ||
mocks/ | ||
.* | ||
|
||
!tests/test-config.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Git Hooks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
echo "Running pre-commit linting..." | ||
make pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
name: Go | ||
|
||
on: [push, pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.1.1 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v5.0.0 | ||
with: | ||
go-version: '1.21.6' | ||
go-version: '1.22.5' | ||
|
||
- name: Verify Go Mod | ||
run: go mod verify | ||
|
@@ -26,7 +26,7 @@ jobs: | |
run: go run honnef.co/go/tools/cmd/staticcheck@latest -f stylish -checks=all,-ST1000,-U1000 ./... | ||
|
||
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v3.7.0 | ||
uses: golangci/golangci-lint-action@v4.0.0 | ||
with: | ||
# during the golangci-lint execution, many files are extracted | ||
# which conflict with those which are cached by the go setup | ||
|
@@ -36,6 +36,13 @@ jobs: | |
# https://github.com/golangci/golangci-lint-action/issues/807 | ||
skip-cache: true | ||
|
||
# - name: Test | ||
# run: go test -v ./... | ||
|
||
- name: Setup FFmpeg | ||
id: setup_ffmpeg | ||
uses: federicocarboni/[email protected] | ||
|
||
- name: Run Tests | ||
uses: robherley/[email protected] | ||
env: | ||
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }} | ||
FORMAT_FFMPEG_BINARY_PATH: ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }}/ffmpeg | ||
FORMAT_FFPROBE_BINARY_PATH: ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }}/ffprobe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.vscode | ||
.env | ||
*.gen.go | ||
mocks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,6 @@ linters-settings: | |
case: | ||
rules: | ||
json: snake | ||
gosec: | ||
excludes: | ||
- G601 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
with-expecter: true | ||
filename: "mock_{{.InterfaceName}}.go" | ||
mockname: "Mock{{.InterfaceName}}" | ||
outpkg: "{{.PackageName}}" | ||
packages: | ||
github.com/hbomb79/Thea/internal/ingest: | ||
config: | ||
dir: "../../internal/ingest/mocks" | ||
interfaces: | ||
Searcher: | ||
Scraper: | ||
DataStore: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.22.1-alpine AS builder | ||
|
||
ENV CGO_ENABLED=0 \ | ||
GOOS=linux \ | ||
GOARCH=amd64 | ||
|
||
WORKDIR / | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go generate ./... | ||
RUN go build -o thea . | ||
|
||
FROM alpine:latest | ||
|
||
COPY ./tests/test-config.toml /config.toml | ||
COPY --from=builder /thea /thea | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/thea"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.