-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
363 additions
and
0 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,66 @@ | ||
name: Push/PR fake prereleases | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
run_static_analysis: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_windows: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_integration_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_build_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_build_windows: | ||
required: false | ||
type: boolean | ||
default: true | ||
|
||
jobs: | ||
static-analysis: | ||
if: ${{ inputs.run_static_analysis }} | ||
uses: ./.github/workflows/static_analysis.yaml | ||
with: | ||
run_job: ${{ inputs.run_static_analysis }} | ||
|
||
test-nix: | ||
if: ${{ inputs.run_test_nix }} | ||
uses: ./.github/workflows/test_nix.yaml | ||
with: | ||
run_job: ${{ inputs.run_test_nix }} | ||
|
||
test-windows: | ||
if: ${{ inputs.run_test_windows }} | ||
uses: ./.github/workflows/test_windows.yaml | ||
with: | ||
run_job: ${{ inputs.run_test_windows }} | ||
|
||
test-integration-nix: | ||
if: ${{ inputs.run_integration_nix }} | ||
uses: ./.github/workflows/test_integration_nix.yaml | ||
with: | ||
run_job: ${{ inputs.run_integration_nix }} | ||
|
||
test-build-nix: | ||
if: ${{ inputs.run_test_build_nix }} | ||
uses: ./.github/workflows/test_build_nix.yaml | ||
with: | ||
run_job: ${{ inputs.run_test_build_nix }} | ||
|
||
test-build-windows: | ||
if: ${{ inputs.run_test_build_nix }} | ||
uses: ./.github/workflows/test_build_windows.yaml | ||
with: | ||
run_job: ${{ inputs.run_test_build_windows }} |
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,73 @@ | ||
name: Push/PR no fake prereleases | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
original_repo_name: | ||
required: true | ||
type: string | ||
run_static_analysis: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_windows: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_integration_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_build_nix: | ||
required: false | ||
type: boolean | ||
default: true | ||
secrets: | ||
docker_hub_id: | ||
description: "docker hub id" | ||
required: false | ||
docker_hub_password: | ||
description: "docker hub password" | ||
required: false | ||
|
||
jobs: | ||
static-analysis: | ||
if: ${{ inputs.run_static_analysis }} | ||
uses: ./.github/workflows/static_analysis.yaml | ||
|
||
test-nix: | ||
if: ${{ inputs.run_test_nix }} | ||
uses: ./.github/workflows/test_nix.yaml | ||
secrets: | ||
docker_hub_id: ${{ secrets.docker_hub_id }} | ||
docker_hub_password: ${{ secrets.docker_hub_password }} | ||
with: | ||
original_repo_name: ${{ inputs.original_repo_name }} | ||
|
||
test-windows: | ||
if: ${{ inputs.run_test_windows }} | ||
uses: ./.github/workflows/test_windows.yaml | ||
with: | ||
run_job: ${{ inputs.run_test_windows }} | ||
original_repo_name: ${{ inputs.original_repo_name }} | ||
|
||
test-integration-nix: | ||
if: ${{ inputs.run_integration_nix }} | ||
uses: ./.github/workflows/test_integration_nix.yaml | ||
secrets: | ||
docker_hub_id: ${{ secrets.docker_hub_id }} | ||
docker_hub_password: ${{ secrets.docker_hub_password }} | ||
with: | ||
run_job: ${{ inputs.run_integration_nix }} | ||
original_repo_name: ${{ inputs.original_repo_name }} | ||
|
||
test-build-nix: | ||
if: ${{ inputs.run_test_build_nix }} | ||
uses: ./.github/workflows/test_build_nix.yaml | ||
secrets: | ||
docker_hub_id: ${{ secrets.docker_hub_id }} | ||
docker_hub_password: ${{ secrets.docker_hub_password }} |
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,23 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
static-analysis: | ||
name: Run all static analysis checks | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: newrelic/newrelic-infra-checkers@v1 | ||
- name: Semgrep | ||
uses: returntocorp/semgrep-action@v1 | ||
with: | ||
auditOn: push | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
continue-on-error: ${{ github.event_name != 'pull_request' }} | ||
with: | ||
only-new-issues: true | ||
- name: Check if CHANGELOG is valid | ||
uses: newrelic/release-toolkit/validate-markdown@v1 |
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,26 @@ | ||
name: Test Build *Nix | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
docker_hub_id: | ||
description: "docker hub id" | ||
required: true | ||
docker_hub_password: | ||
description: "docker hub password" | ||
required: true | ||
|
||
jobs: | ||
test-build-nix: | ||
name: Test binary compilation for all platforms:arch | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to DockerHub | ||
if: ${{ inputs.docker_hub_id }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ inputs.docker_hub_id }} | ||
password: ${{ inputs.docker_hub_password }} | ||
- name: Build all platforms:arch | ||
run: make ci/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,71 @@ | ||
name: Test Build Windows | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
run_job: | ||
required: false | ||
type: boolean | ||
default: true | ||
original_repo_name: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
secrets: | ||
pfx_certificate_base64: | ||
description: "pfx base64 certificate" | ||
required: true | ||
pfx_passphrase: | ||
description: "pfx passphrase" | ||
required: true | ||
|
||
jobs: | ||
test-build-windows: | ||
if: ${{ inputs.run_job }} | ||
name: Create MSI | ||
runs-on: windows-latest | ||
needs: [ test-build-nix ] | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
PFX_CERTIFICATE_BASE64: ${{ inputs.pfx_certificate_base64 }} | ||
PFX_CERTIFICATE_DESCRIPTION: 'New Relic' | ||
PFX_PASSPHRASE: ${{ inputs.pfx_passphrase }} | ||
ORIGINAL_REPO_NAME: ${{ inputs.original_repo_name }} | ||
TAG: ${{ inputs.tag }} | ||
defaults: | ||
run: | ||
working-directory: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | ||
strategy: | ||
matrix: | ||
goarch: [ amd64,386 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | ||
- shell: bash | ||
run: git tag "$TAG" | ||
|
||
- name: Download artifact from previous job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: windows-packages | ||
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }}/dist/ | ||
|
||
- name: Get PFX certificate from GH secrets | ||
shell: bash | ||
run: | | ||
if [ -z "$PFX_CERTIFICATE_BASE64" ]; then | ||
echo NO_SIGN=true >> $GITHUB_ENV | ||
else | ||
printf "%s" "$PFX_CERTIFICATE_BASE64" | base64 -d - > wincert.pfx | ||
fi | ||
- name: Extract .exe | ||
shell: pwsh | ||
run: build\windows\extract_exe.ps1 "$env:INTEGRATION" ${{ matrix.goarch }} "$env:TAG" | ||
- name: Create MSI | ||
shell: pwsh | ||
run: build\windows\package_msi.ps1 -integration "$env:INTEGRATION" -arch ${{ matrix.goarch }} -tag "$env:TAG" -pfx_passphrase "$env:PFX_PASSPHRASE" -pfx_certificate_description "$env:PFX_CERTIFICATE_DESCRIPTION" |
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,45 @@ | ||
name: Integration Tests on *Nix | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
run_job: | ||
required: false | ||
type: boolean | ||
default: true | ||
original_repo_name: | ||
required: true | ||
type: string | ||
secrets: | ||
docker_hub_id: | ||
description: "docker hub id" | ||
required: true | ||
docker_hub_password: | ||
description: "docker hub password" | ||
required: true | ||
|
||
jobs: | ||
test-integration-nix: | ||
if: ${{ inputs.run_job }} | ||
name: Run integration tests on *Nix | ||
runs-on: ubuntu-20.04 | ||
env: | ||
ORIGINAL_REPO_NAME: ${{ inputs.original_repo_name }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "src/github.com/${{ env.ORIGINAL_REPO_NAME }}/go.mod" | ||
- name: Login to DockerHub | ||
if: ${{ inputs.docker_hub_id }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ inputs.docker_hub_id }} | ||
password: ${{ inputs.docker_hub_password }} | ||
- name: Integration test | ||
run: make integration-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,26 @@ | ||
name: Unit Tests on *Nix | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
docker_hub_id: | ||
description: "docker hub id" | ||
required: true | ||
docker_hub_password: | ||
description: "docker hub password" | ||
required: true | ||
|
||
jobs: | ||
test-nix: | ||
name: Run unit tests on *Nix | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to DockerHub | ||
if: ${{ inputs.docker_hub_id }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ inputs.docker_hub_id }} | ||
password: ${{ inputs.docker_hub_password }} | ||
- name: Unit tests | ||
run: make ci/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,33 @@ | ||
name: Unit Tests on Windows | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
run_job: | ||
required: false | ||
type: boolean | ||
default: true | ||
original_repo_name: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-windows: | ||
if: ${{ inputs.run_job }} | ||
name: Run unit tests on Windows | ||
runs-on: windows-2019 | ||
env: | ||
ORIGINAL_REPO_NAME: ${{ inputs.original_repo_name }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: src/github.com/${{ inputs.original_repo_name }} | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "src/github.com/${{ inputs.original_repo_name }}/go.mod" | ||
- name: Running unit tests | ||
shell: pwsh | ||
run: | | ||
.\build\windows\unit_tests.ps1 |