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/**
frontend/dist/**
frontend/node_modules/**

View File

@ -1,70 +1,31 @@
name: main
name: main job
on:
push:
branches:
- 'master'
tags:
- 'v*'
- 'main'
- 'v\d+.\d+.\d+'
pull_request:
branches:
- 'main'
- 'v\d+.\d+.\d+'
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:
runs-on: ubuntu-latest
needs: [test-frontend, test-backend]
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:
runs-on: ubuntu-latest

View File

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

View File

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

View File

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

View File

@ -6,7 +6,10 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"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": {
"ace-builds": "^1.4.7",