updated workflow

This commit is contained in:
Graham Steffaniak 2023-09-15 15:57:22 -05:00
parent 18f5cdd90e
commit 60fd41f11c
7 changed files with 29 additions and 66 deletions

View File

@ -1,4 +1,4 @@
backend/database.db backend/**.db
backend/vendor/** backend/vendor/**
frontend/dist/** frontend/dist/**
frontend/node_modules/** frontend/node_modules/**

View File

@ -1,70 +1,31 @@
name: main name: main job
on: on:
push: push:
branches: branches:
- 'master' - 'main'
tags: - 'v\d+.\d+.\d+'
- 'v*'
pull_request: pull_request:
branches:
- 'main'
- 'v\d+.\d+.\d+'
jobs: jobs:
# linters
lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: make lint-frontend
lint-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.20.1
- run: make lint-backend
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: make lint-commits
lint:
runs-on: ubuntu-latest
needs: [lint-frontend, lint-backend, lint-commits]
steps:
- run: echo "done"
# tests
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: make test-frontend
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.20.1
- run: make test-backend
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test-frontend, test-backend]
steps: steps:
- run: echo "done" - uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.21.1
- run: cd backend && go test -race -v ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.21.1
- run: go fmt
# release # release
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -8,6 +8,7 @@ RUN npm run build
FROM golang:1.21-alpine as base FROM golang:1.21-alpine as base
WORKDIR /app WORKDIR /app
COPY ./backend ./ COPY ./backend ./
RUN go get -u golang.org/x/net
RUN go build -ldflags="-w -s" -o filebrowser . RUN go build -ldflags="-w -s" -o filebrowser .
FROM alpine:latest FROM alpine:latest

View File

@ -1,6 +1,6 @@
module github.com/gtsteffaniak/filebrowser module github.com/gtsteffaniak/filebrowser
go 1.21.0 go 1.21
require ( require (
github.com/asdine/storm/v3 v3.2.1 github.com/asdine/storm/v3 v3.2.1

View File

@ -9,8 +9,7 @@ import (
) )
func TestConfigLoadChanged(t *testing.T) { func TestConfigLoadChanged(t *testing.T) {
configYml = "./testingConfig.yaml" yamlData := loadConfigFile("./testingConfig.yaml")
yamlData := loadConfigFile()
// Marshal the YAML data to a more human-readable format // Marshal the YAML data to a more human-readable format
newConfig := setDefaults() newConfig := setDefaults()
GlobalConfiguration := setDefaults() GlobalConfiguration := setDefaults()
@ -26,8 +25,7 @@ func TestConfigLoadChanged(t *testing.T) {
} }
func TestConfigLoadSpecificValues(t *testing.T) { func TestConfigLoadSpecificValues(t *testing.T) {
configYml = "./testingConfig.yaml" yamlData := loadConfigFile("./testingConfig.yaml")
yamlData := loadConfigFile()
// Marshal the YAML data to a more human-readable format // Marshal the YAML data to a more human-readable format
newConfig := setDefaults() newConfig := setDefaults()
GlobalConfiguration := setDefaults() GlobalConfiguration := setDefaults()

View File

@ -20,7 +20,7 @@ func (s settingsBackend) Save(set *settings.Settings) error {
func (s settingsBackend) GetServer() (*settings.Server, error) { func (s settingsBackend) GetServer() (*settings.Server, error) {
server := &settings.Server{ server := &settings.Server{
Port: 8080, Port: 8080,
NumImageProcessors: 1, NumImageProcessors: 1,
} }
return server, get(s.db, "server", server) return server, get(s.db, "server", server)

View File

@ -6,7 +6,10 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"fix": "npx vue-cli-service lint", "fix": "npx vue-cli-service lint",
"watch": "vue-cli-service build --watch" "watch": "vue-cli-service build --watch",
"lint": "eslint --ext .vue,.js src/",
"lint:fix": "eslint --ext .vue,.js --fix src/",
"format": "prettier --write ."
}, },
"dependencies": { "dependencies": {
"ace-builds": "^1.4.7", "ace-builds": "^1.4.7",