-
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #1 from armbian/feature/refactor
Refactoring and half rewrite
- Loading branch information
Showing
22 changed files
with
889 additions
and
390 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,83 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CICD | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- staging | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- staging | ||
- develop | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# The "build" workflow | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Go | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.18' # The Go version to download (if necessary) and use. | ||
|
||
# Install all the dependencies | ||
- name: Install dependencies | ||
run: | | ||
go version | ||
go install -mod=mod golang.org/x/lint/golint | ||
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo | ||
# Run vet & lint on the code | ||
- name: Run vet & lint | ||
run: | | ||
go vet . | ||
golint . | ||
# Run testing on the code | ||
- name: Run testing | ||
run: | | ||
ginkgo --randomize-all --p --cover --coverprofile=cover.out . | ||
go tool cover -func=cover.out | ||
# Install build tool | ||
- name: Install build tool | ||
run: go install github.com/tystuyfzand/goc@latest | ||
|
||
# Run build of the application | ||
- name: Run build | ||
run: | | ||
mkdir build/ | ||
goc -o build/dlrouter cmd/main.go | ||
env: | ||
GOOS: linux,windows,darwin,openbsd,freebsd | ||
GOARCH: 386,amd64,arm,arm64 | ||
|
||
# Upload artifacts | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
path: build/ | ||
|
||
# The "deploy" workflow | ||
deploy: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
needs: [build] # Only run this workflow when "build" workflow succeeds | ||
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} # Only run this workflow if it is master branch on push event | ||
steps: | ||
- uses: actions/checkout@v2 |
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ userdata.csv | |
dlrouter-apt.yaml | ||
*.yaml | ||
!dlrouter.yaml | ||
*.exe | ||
*.exe | ||
dlrouter | ||
cover.out |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package redirector | ||
|
||
import ( | ||
"testing" | ||
|
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.