Skip to content

Commit 1368d96

Browse files
authored
Merge pull request #418 from orca-group/develop
spacebin v2
2 parents 414f6a4 + 2339881 commit 1368d96

Some content is hidden

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

60 files changed

+3709
-1305
lines changed

.commitlintrc.json

-3
This file was deleted.

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ indent_size = 4
1616
trim_trailing_whitespace = false
1717
eclint_indent_style = unset
1818

19+
[*.js]
20+
indent_size = 2
21+
1922
[*{.toml,.json,.yaml,.yml}]
2023
indent_size = 2
File renamed without changes.
File renamed without changes.

.github/ISSUE_TEMPLATE/bug_report.md

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ assignees: ''
77

88
---
99

10-
<!-- REMEMBER: Issues related to any clients are not meant for this repository. This is for server/backend issues only. -->
11-
1210
### Describe the bug
1311

1412
A clear and concise description of what the bug is... In other words, what happened?

.github/ISSUE_TEMPLATE/feature_request.md

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ assignees: ''
77

88
---
99

10-
<!-- REMEMBER: Issues related to any clients are not meant for this repository. This is for server/backend issues only. -->
11-
1210
### Is your feature request related to a problem? Please describe
1311

1412
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

.github/dependabot.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ updates:
33
- package-ecosystem: gomod
44
directory: "/"
55
schedule:
6-
interval: daily
7-
time: "13:00"
6+
interval: weekly
7+
target-branch: develop
88
open-pull-requests-limit: 10
99
reviewers:
1010
- lukewhrit

.github/workflows/build.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
name: build
1+
name: Build
22
on: [push, pull_request]
33

44
jobs:
5-
mage:
5+
build:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout Repository
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v3
1010
- name: setup go
11-
uses: actions/setup-go@v2
11+
uses: actions/setup-go@v4
1212
with:
13-
go-version: 1.15.2
14-
- name: run mage
15-
uses: magefile/mage-action@v1
16-
with:
17-
version: latest
18-
args: build
13+
go-version: 1.22.4
14+
- name: run make
15+
run: make spirit

.github/workflows/codeql-analysis.yml

+49-38
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,60 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
name: codeql
1+
2+
name: CodeQL
3+
74
on:
85
push:
96
branches: [main, develop]
107
pull_request:
11-
branches: [main]
8+
branches: [main, develop]
129
schedule:
13-
- cron: '0 11 * * 2'
10+
# ┌───────────── minute (0 - 59)
11+
# │ ┌───────────── hour (0 - 23)
12+
# │ │ ┌───────────── day of the month (1 - 31)
13+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
14+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
15+
# │ │ │ │ │
16+
# * * * * *
17+
- cron: '30 1 * * 0'
1418

1519
jobs:
16-
analyze:
17-
name: analyze
20+
CodeQL-Build:
21+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1822
runs-on: ubuntu-latest
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
# Override automatic language detection by changing the below list
23-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
24-
language: ['go']
23+
24+
permissions:
25+
# required for all workflows
26+
security-events: write
27+
28+
# only required for workflows in private repositories
29+
actions: read
30+
contents: read
31+
2532
steps:
26-
- name: checkout repository
27-
uses: actions/checkout@v2
28-
with:
29-
# We must fetch at least the immediate parents so that if this is
30-
# a pull request then we can checkout the head.
31-
fetch-depth: 2
32-
33-
# If this run was triggered by a pull request event, then checkout
34-
# the head of the pull request instead of the merge commit.
35-
- run: git checkout HEAD^2
36-
if: ${{ github.event_name == 'pull_request' }}
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
3735

3836
# Initializes the CodeQL tools for scanning.
39-
- name: initialize CodeQL
40-
uses: github/codeql-action/init@v1
41-
with:
42-
languages: ${{ matrix.language }}
43-
44-
# Auto-build attempts to build any compiled languages (C/C++, C#, or Java).
45-
# If this step fails, then you should remove it and run the build manually (see below)
46-
- name: auto-build
47-
uses: github/codeql-action/autobuild@v1
48-
- name: perform CodeQL analysis
49-
uses: github/codeql-action/analyze@v1
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v2
39+
# Override language selection by uncommenting this and choosing your languages
40+
# with:
41+
# languages: go, javascript, csharp, python, cpp, java, ruby
42+
43+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
44+
# If this step fails, then you should remove it and run the build manually (see below).
45+
- name: Autobuild
46+
uses: github/codeql-action/autobuild@v2
47+
48+
# ℹ️ Command-line programs to run using the OS shell.
49+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
50+
51+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
52+
# three lines and modify them (or add more) to build your code if your
53+
# project uses a compiled language
54+
55+
#- run: |
56+
# make bootstrap
57+
# make release
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v2

.github/workflows/commitlint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: commitlint
1+
name: Commit Lint
22
on: [pull_request, push]
33

44
jobs:
55
commitlint:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
with:
1010
fetch-depth: 0
11-
- uses: wagoid/commitlint-github-action@v2
11+
- uses: wagoid/commitlint-github-action@v5

.github/workflows/format.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
name: format
1+
name: Format
22
on: [push, pull_request]
33

44
jobs:
5-
mage:
5+
format:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout Repository
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v3
1010
- name: setup go
11-
uses: actions/setup-go@v2
11+
uses: actions/setup-go@v4
1212
with:
13-
go-version: 1.15.2
14-
- name: run mage
15-
uses: magefile/mage-action@v1
16-
with:
17-
version: latest
18-
args: format
13+
go-version: 1.22.4
14+
- name: run make
15+
run: make format

.github/workflows/release.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build release binaries
1+
name: Build for Release
22
on: [release]
33

44
jobs:
@@ -62,3 +62,17 @@ jobs:
6262
GOARCH: amd64
6363
GOOS: windows
6464
EXTRA_FILES: 'license'
65+
docker:
66+
name: publish to docker
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@master
70+
- name: Set up Docker Buildx
71+
uses: docker/setup-buildx-action@v2
72+
- name: Login to Docker Hub
73+
uses: docker/login-action@v2
74+
with:
75+
username: ${{ secrets.DOCKERHUB_USERNAME }}
76+
password: ${{ secrets.DOCKERHUB_TOKEN }}
77+
- name: Build and push Docker images
78+
uses: docker/build-push-action@v3.2.0

.github/workflows/test.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Tests and Coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
coverage:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 2
12+
- uses: actions/setup-go@v4
13+
with:
14+
go-version: 1.22.4
15+
- name: Run coverage
16+
run: go test ./... -race -coverprofile=coverage.out -covermode=atomic
17+
- name: Upload coverage to Codecov
18+
uses: codecov/codecov-action@v3

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.16.1-alpine3.13
1+
FROM golang:1.20.7-alpine3.18
22

33
RUN mkdir /opt/spirit
44

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
OUT := bin/spirit
2+
3+
.PHONY: clean
4+
5+
all: spirit
6+
7+
spirit: clean
8+
@go mod download
9+
go build --ldflags "-s -w" -o $(OUT) ./cmd/spirit/main.go
10+
11+
clean:
12+
rm -rf bin/
13+
14+
run: spirit
15+
./bin/spirit
16+
17+
format:
18+
go fmt ./...
19+
20+
test:
21+
go test ./... -v -race

0 commit comments

Comments
 (0)