-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Move to multiple distro and simplify ci #194
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1992503
chore: Move nightly config and add signign
mailo-nr 55437c7
chore: sign rpm/deb
mailo-nr ead3e09
feat: Refactoring ci to facilitate multiple distros
mailo-nr a769ea9
feat: Re-arrange configs
mailo-nr 21d8f03
chore: Skips steps when running ci locally via act
mailo-nr ef30363
chore: PR feedback
mailo-nr c5b5a7e
chore: Add helm back to ci
mailo-nr e218804
chore: Use correct arch locally
mailo-nr e17fd9c
chore: Temporarily exclude k8s distro
mailo-nr 9afa5c2
fix: PR review changes
kb-newrelic 5d85252
chore: Standardize arch for ci
mailo-nr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
# .actrc | ||
--container-architecture=linux/arm64 | ||
-P ubuntu-latest=catthehacker/ubuntu:act-latest | ||
-e event.json |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,11 @@ jobs: | |
build: | ||
name: Validate distributions build, third party libraries and security | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dist: | ||
- nr-otel-collector | ||
- nrdot-collector-k8s | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -29,25 +34,55 @@ jobs: | |
go-version: '1.23' | ||
check-latest: true | ||
|
||
- name: Tidy go.mod files | ||
run: go mod tidy | ||
|
||
- name: Verify build | ||
run: make ci | ||
run: make ci DISTRIBUTIONS=${{ matrix.dist }} | ||
|
||
- name: Validate distributions third party libraries | ||
run: make licenses-check | ||
- name: Login to Docker | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.OTELCOMM_DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.OTELCOMM_DOCKER_HUB_PASSWORD }} | ||
|
||
- uses: docker/setup-qemu-action@v2 | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} | ||
passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }} | ||
|
||
- name: Write GPG to path in memory for signing rpm/deb | ||
id: write_gpg_to_path | ||
run: | | ||
GPG_KEY_PATH="$(mktemp /dev/shm/gpg.XXXXXX)" | ||
echo "$GPG_PRIVATE_KEY" | base64 -d >> "$GPG_KEY_PATH" | ||
echo "gpg_key_path=$GPG_KEY_PATH" >> $GITHUB_OUTPUT | ||
env: | ||
GPG_PRIVATE_KEY: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} | ||
|
||
- name: Build binaries & packages with GoReleaser | ||
id: goreleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
env: | ||
NFPM_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GPG_KEY_PATH: ${{ steps.write_gpg_to_path.outputs.gpg_key_path }} | ||
REGISTRY: "newrelic/${{ matrix.dist }}" | ||
with: | ||
distribution: goreleaser | ||
version: '~> v2' | ||
args: --snapshot --clean --skip=sign --timeout 2h | ||
args: --snapshot --clean --skip=publish,validate --timeout 2h | ||
workdir: distributions/${{ matrix.dist }} | ||
|
||
- name: Extract image version | ||
run: echo "version=$(jq -r '.version' dist/metadata.json)" >> $GITHUB_ENV | ||
run: echo "version=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.version')" >> $GITHUB_ENV | ||
|
||
- name: Setup local kind cluster | ||
uses: helm/kind-action@v1 | ||
|
@@ -56,28 +91,31 @@ jobs: | |
cluster_name: ${{ env.TEST_CLUSTER_NAME }} | ||
wait: 60s | ||
|
||
- uses: azure/[email protected] | ||
mailo-nr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run local e2e tests | ||
run: | | ||
IMAGE_TAG=${{ env.version }}-rc-amd64 \ | ||
IMAGE_TAG=${{ env.version }}-amd64 \ | ||
KIND_CLUSTER_NAME=${{ env.TEST_CLUSTER_NAME }} \ | ||
make -f ./test/e2e/Makefile ci_test-fast | ||
make -f ./test/e2e/Makefile ci_test-fast DISTRO=${{ matrix.dist }} | ||
|
||
- name: Trivy security check | ||
uses: aquasecurity/trivy-action@0.28.0 | ||
uses: aquasecurity/trivy-action@0.29.0 | ||
with: | ||
image-ref: "newrelic/nr-otel-collector:${{ env.version }}-rc-amd64" | ||
image-ref: "newrelic/${{ matrix.dist }}:${{ env.version }}-amd64" | ||
format: 'table' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: "HIGH,CRITICAL" | ||
env: | ||
# dbs are downloaded async in download_trivy_db.yml | ||
TRIVY_SKIP_DB_UPDATE: true | ||
# dbs are downloaded async in trivy-cache.yml | ||
TRIVY_SKIP_DB_UPDATE: ${{ !env.ACT }} | ||
TRIVY_SKIP_JAVA_DB_UPDATE: true | ||
|
||
terraform: | ||
uses: ./.github/workflows/component_terraform.yml | ||
if: github.event.pull_request.user.login != 'dependabot[bot]' | ||
uses: ./.github/workflows/terraform.yml | ||
if: ${{ !github.event.act && github.event.pull_request.user.login != 'dependabot[bot]' }} | ||
kb-newrelic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
branch: ${{ github.ref }} | ||
tf_work_subdir: permanent | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.