-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gh action workflow to mirror circle ci #468
base: main
Are you sure you want to change the base?
Changes from all commits
d860f40
11034ba
abff4d5
a840939
9a6f01f
bb5d29e
ca370e6
7a975dd
d2a0731
c41fcd9
479a579
795bba7
ba05af2
99cf78c
2fa72a0
f7d1503
8584bca
a6d0041
49ea11e
5e7e14d
f6619ba
b79b7b5
e353892
3b58eda
e68f87d
1035cae
511460a
2eba4b5
c8694a6
2dcaa8f
0672bbe
17c632f
902c901
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish JUnit Tests | ||
description: Publishes JUnit tests to one or more sources | ||
inputs: | ||
files: | ||
required: true | ||
description: The JUnit files to upload | ||
name: | ||
required: true | ||
description: The name of the suite | ||
datadog: | ||
required: false | ||
description: Upload to Datadog | ||
default: 'true' | ||
github: | ||
required: false | ||
description: Upload to GitHub | ||
default: 'true' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Report Tests to Datadog | ||
shell: bash | ||
if: ${{ inputs.datadog }} == 'true' | ||
run: datadog-ci junit upload --service ${{ inputs.name }} ${{ inputs.files }} | ||
|
||
- name: Test Publish | ||
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # v15 | ||
if: ${{ inputs.github }} == 'true' | ||
with: | ||
name: ${{ inputs.name }} | ||
output-to: step-summary | ||
path: ${{ inputs.files }} | ||
reporter: java-junit | ||
fail-on-error: 'false' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Test and Generate Docs | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
go-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Install datadog-ci | ||
run: npm install -g @datadog/datadog-ci | ||
|
||
- name: Install Dependencies | ||
run: | | ||
go install github.com/jstemmer/go-junit-report@v1.0.0 | ||
go install github.com/kyoh86/richgo@v0.3.10 | ||
go install gotest.tools/gotestsum@latest | ||
|
||
- name: Install golangci-lint | ||
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 | ||
with: | ||
version: v1.62.2 | ||
|
||
- name: Run golangci-lint | ||
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | ||
with: | ||
extra_args: golangci-lint --all-files | ||
|
||
- name: Run tests with gotestsum | ||
run: | | ||
mkdir -p ${{ github.workspace }}/artifacts | ||
mkdir -p ${{ github.workspace }}/reports | ||
gotestsum --packages="./..." \ | ||
--junitfile ${{ github.workspace }}/reports/go-test_go_tests.xml \ | ||
--jsonfile ${{ github.workspace }}/artifacts/go-test_go_tests.json \ | ||
--rerun-fails=2 \ | ||
--rerun-fails-max-failures=10 \ | ||
--rerun-fails-report ${{ github.workspace }}/artifacts/rerun_tests_go_tests.txt | ||
|
||
- name: Publish JUnit Tests | ||
uses: ./.github/actions/publish-junit | ||
env: | ||
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} | ||
with: | ||
files: ${{ github.workspace }}/reports/go-test_go_tests.xml | ||
name: find-code-references-in-pull-request | ||
datadog: 'true' | ||
github: 'true' | ||
|
||
github-actions-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
|
||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install action-docs | ||
run: npm install action-docs | ||
|
||
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | ||
with: | ||
extra_args: github-action-docs --all-files |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ type flag struct { | |
usage string | ||
} | ||
|
||
const ( | ||
anotherDefaultFlagValue = 10 // Descriptive constant for another default flag value | ||
) | ||
|
||
// Options that are available as command line flags | ||
var flags = []flag{ | ||
{ | ||
|
@@ -45,7 +49,7 @@ Allowed template variables: 'branchName', 'sha'. If "commitUrlTemplate" is not p | |
{ | ||
name: "contextLines", | ||
short: "C", | ||
defaultValue: 2, | ||
defaultValue: anotherDefaultFlagValue, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels strange to set as a constant. Which linter is complaining? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Imo revert these const changes, and disable whatever linter is complaining, I don't agree that these things should be constants. Maybe the shortShaLength is the only one that I'd put as a constant. |
||
usage: `The number of context lines to send to LaunchDarkly. If < 0, no | ||
source code will be sent to LaunchDarkly. If 0, only the lines containing | ||
flag references will be sent. If > 0, will send that number of context | ||
|
@@ -94,7 +98,7 @@ LaunchDarkly API is unreachable or returns an unexpected response.`, | |
{ | ||
name: "lookback", | ||
short: "l", | ||
defaultValue: 10, | ||
defaultValue: 10, //nolint:mnd | ||
usage: `Sets the number of git commits to search in history for | ||
whether a feature flag was removed from code. May be set to 0 to disabled this feature. Setting this option to a high value will increase search time.`, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous step already runs golangci-lint