-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run CI on a PR * Add a readme * Additional ignores * Add to README
- Loading branch information
Showing
6 changed files
with
85 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
GO_VERSION=1.21.3 | ||
|
||
UNIT_TEST_SCOPE=./cmd/... ./pkg/... |
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: PR | ||
|
||
on: | ||
pull_request: | ||
types: ['opened', 'reopened', 'synchronize'] | ||
branches: [ "main" ] | ||
paths: | ||
- '**' # all files otherwise excludes wont work | ||
- '!**/**/*.md' # ignore markdown files | ||
- '!demo/**' # ignore demos folder | ||
- '!sample/**' # ignore samples folder | ||
- '!example/**' # ignore examples folder | ||
|
||
jobs: | ||
vet: | ||
uses: ./.github/workflows/vet.yml | ||
unit-test: | ||
uses: ./.github/workflows/unit.yml | ||
build: | ||
uses: ./.github/workflows/build.yml |
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,11 @@ | ||
# Workflows | ||
|
||
There are two types of workflows in this directory. I would put them in subfolders but GitHub doesn't support that. | ||
|
||
## Callers | ||
|
||
These are the high level workflows that can be associated with what triggers them. PRs, releases, nightlys, merges, etc. These are made up of jobs that are defined the the other workflows. These are the workflows that you will see in the Actions tab of the repo. By grouping these tasks into parent workflows, the jobs are grouped under one action in the actions tab. They share the smaller 'job' workflows so that they always run the same way. Convention has become to capitalize the first letter of these workflow's name. | ||
|
||
## Jobs | ||
|
||
These are the smaller individual tasks that are used to build up the larger parent workflows. They can be thought of as running unit tests, building the binaries, or linting the code. When you open one of the parent caller actions in the actions tab, they will show these individual jobs. Convention has become to lowercase the first letter of these workflow's name. |
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: Run Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment | ||
uses: c-py/action-dotenv-to-setenv@v4 | ||
with: | ||
env-file: .github/development.env | ||
|
||
- name: Setup Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Run Unit Tests | ||
working-directory: . | ||
run: make test |
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: Vet Go Code | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
vet: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment | ||
uses: c-py/action-dotenv-to-setenv@v4 | ||
with: | ||
env-file: .github/development.env | ||
|
||
- name: Setup Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Vet Go Code | ||
working-directory: . | ||
run: make vet |