-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-tailwind-themes
- Loading branch information
Showing
41 changed files
with
1,589 additions
and
309 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
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,25 @@ | ||
name: golangci-lint step | ||
description: golangci-lint step | ||
inputs: | ||
linters: | ||
description: Linter to run | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Generating templ files | ||
run: | | ||
templ generate | ||
shell: bash | ||
|
||
- name: prepping lint commands | ||
id: set-command | ||
run: | | ||
export LINTERS="${{ inputs.linters }}" | ||
export LINTER_CMD="golangci-lint run --disable-all -E ${LINTERS//;/ -E }" | ||
echo "linter_cmd=${LINTER_CMD}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: running the linter command | ||
run: eval ${{ steps.set-command.outputs.linter_cmd }} | ||
shell: bash |
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,30 @@ | ||
name: Build | ||
|
||
on: [workflow_call] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
name: Build ⚒️ | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: mattgomes28/urchin-golang:0.2 | ||
options: --user 1001 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checking Out Repo 👀 | ||
- name: Golang Build 🐹 | ||
run: make build | ||
- name: Package 📦 | ||
run: | | ||
mkdir urchin-ubuntu-build | ||
cp tmp/urchin urchin-ubuntu-build/ | ||
cp tmp/urchin-admin urchin-ubuntu-build/ | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: urchin-ubuntu-build | ||
path: urchin-ubuntu-build |
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,20 @@ | ||
name: Fail Fast | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
linters: | ||
name: Linters 🧑🔬 | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: mattgomes28/urchin-golang:0.2 | ||
options: --user 1001 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/workflows/actions/golangci-lint | ||
name: Running Linters 🧪 | ||
with: | ||
linters: errcheck;staticcheck;unused;gosimple;gofmt |
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,24 @@ | ||
name: Urchin CI ⚗️ | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
failfast: | ||
uses: ./.github/workflows/failfast.yml | ||
|
||
build: | ||
uses: ./.github/workflows/build.yml | ||
needs: failfast | ||
|
||
tests: | ||
uses: ./.github/workflows/test.yml | ||
needs: build | ||
|
||
# release: | ||
# uses: ./.github/workflows/release.yml | ||
# needs: tests | ||
# if: github.ref == 'refs/heads/main' |
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,27 @@ | ||
name: Tests | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
linters: | ||
name: Tests 🧪 | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: mattgomes28/urchin-golang:0.2 | ||
options: --user 1001 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Generating templ files | ||
run: | | ||
templ generate | ||
shell: bash | ||
|
||
- name: Running Go Tests 🧪 | ||
run: | | ||
go test -coverprofile=coverage.out -covermode=atomic ./... -v | ||
- name: Upload coverage to Codecov 📓 | ||
uses: codecov/codecov-action@v3 |
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,3 +1,4 @@ | ||
.vscode | ||
**/__debug* | ||
**/*_templ.go | ||
tmp/ |
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 |
---|---|---|
|
@@ -17,6 +17,8 @@ build: | |
$(TAILWIND) -i ./static/style.css -o ./static/output.css -m | ||
$(GOCMD) build -v -o $(BUILD_DIR)/$(BINARY_NAME) $(URCHIN_DIR) | ||
$(GOCMD) build -v -o $(BUILD_DIR)/$(ADMIN_BINARY_NAME) $(URCHIN_ADMIN_DIR) | ||
GIN_MODE=release $(GOCMD) build -ldflags "-s" -v -o $(BUILD_DIR)/$(BINARY_NAME) $(URCHIN_DIR) | ||
GIN_MODE=release $(GOCMD) build -ldflags "-s" -v -o $(BUILD_DIR)/$(ADMIN_BINARY_NAME) $(URCHIN_ADMIN_DIR) | ||
|
||
test: | ||
$(GOCMD) test -v ./... | ||
|
@@ -25,4 +27,7 @@ clean: | |
$(GOCMD) clean | ||
rm -rf $(BUILD_DIR) | ||
|
||
install-tools: | ||
go install github.com/a-h/templ/cmd/[email protected] | ||
|
||
.PHONY: all build test clean |
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.