Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

chore(deps): bump golang.org/x/net from 0.17.0 to 0.23.0 in /engine/nats-manager #1084

chore(deps): bump golang.org/x/net from 0.17.0 to 0.23.0 in /engine/nats-manager

chore(deps): bump golang.org/x/net from 0.17.0 to 0.23.0 in /engine/nats-manager #1084

Workflow file for this run

name: Test and release
on:
push:
branches:
- main
- develop
- 'release/**'
- 'hotfix/**'
tags-ignore:
- '*'
pull_request:
paths:
- 'engine/**/*'
- 'helm/**/*'
- '.github/workflows/test-release.yaml'
branches:
# Destination branches
- 'develop'
jobs:
check-folder-changes:
# Avoid running when Nyx commits changes
if: ${{ !contains(github.event.head_commit.message, 'Release version') }}
runs-on: ubuntu-latest
name: Check folder changes
outputs:
admin-api: ${{ steps.filter.outputs.admin-api }}
k8s-manager: ${{ steps.filter.outputs.k8s-manager }}
nats-manager: ${{ steps.filter.outputs.nats-manager }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
admin-api:
- 'engine/admin-api/**/*'
- '.github/workflows/test-release.yaml'
k8s-manager:
- 'engine/k8s-manager/**/*'
- '.github/workflows/test-release.yaml'
nats-manager:
- 'engine/nats-manager/**/*'
- '.github/workflows/test-release.yaml'
unit-tests:
# Avoid running when Nyx commits changes
if: ${{ !contains(github.event.head_commit.message, 'Release version') }}
runs-on: ubuntu-latest
name: Linting and Unit tests
needs: check-folder-changes
strategy:
fail-fast: true
matrix:
include:
- component: admin-api
changes: ${{ needs.check-folder-changes.outputs.admin-api }}
- component: k8s-manager
changes: ${{ needs.check-folder-changes.outputs.k8s-manager }}
- component: nats-manager
changes: ${{ needs.check-folder-changes.outputs.nats-manager }}
steps:
- name: Checkout code
if: matrix.changes == 'true'
uses: actions/checkout@v4
- name: Install Go
if: matrix.changes == 'true'
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Run golangci-lint
if: matrix.changes == 'true'
uses: golangci/golangci-lint-action@v4
with:
version: latest
working-directory: ./engine/${{ matrix.component }}
args: --timeout=5m
- name: Run unit tests
if: matrix.changes == 'true'
run: go test ./... -cover -v -coverpkg=./... -coverprofile=coverage-unit.out --tags=unit
working-directory: ./engine/${{ matrix.component }}
- name: Run integration tests
if: matrix.changes == 'true'
run: go test ./... -cover -v -coverpkg=./... -coverprofile=coverage-integration.out --tags=integration
working-directory: ./engine/${{ matrix.component }}
- name: Archive code coverage results
if: matrix.changes == 'true'
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.component }}
path: |
engine/${{ matrix.component }}/coverage-unit.out
engine/${{ matrix.component }}/coverage-integration.out
sonarcloud:
# Avoid running when Nyx commits changes
if: ${{ !contains(github.event.head_commit.message, 'Release version') }}
name: SonarCloud
runs-on: ubuntu-latest
needs:
- check-folder-changes
- unit-tests
strategy:
fail-fast: true
matrix:
include:
- component: admin-api
changes: ${{ needs.check-folder-changes.outputs.admin-api }}
sonar_token_secret: SONAR_TOKEN_ADMIN_API
- component: k8s-manager
changes: ${{ needs.check-folder-changes.outputs.k8s-manager }}
sonar_token_secret: SONAR_TOKEN_K8S_MANAGER
- component: nats-manager
changes: ${{ needs.check-folder-changes.outputs.nats-manager }}
sonar_token_secret: SONAR_TOKEN_NATS_MANAGER
steps:
- uses: actions/checkout@v4
if: matrix.changes == 'true'
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Download code coverage results
if: matrix.changes == 'true'
uses: actions/download-artifact@v4
with:
name: coverage-report-${{ matrix.component }}
path: |
engine/${{ matrix.component }}
- name: SonarCloud Scan
if: matrix.changes == 'true'
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: engine/${{ matrix.component }}
env:
GITHUB_TOKEN: ${{ secrets.PAT }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets[matrix.sonar_token_secret] }}
release-version:
# Avoid running when Nyx commits changes
if: ${{ !contains(github.event.head_commit.message, 'Release version') }}
name: Publish the release (if any) with Nyx
needs: SonarCloud
runs-on: ubuntu-latest
env:
NYX_VERBOSITY: 'INFO'
outputs:
newRelease: ${{ steps.nyx-publish.outputs.newRelease }}
newVersion: ${{ steps.nyx-publish.outputs.newVersion }}
version: ${{ steps.nyx-publish.outputs.version }}
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run nyx Infer
id: nyx-infer
uses: mooltiverse/nyx-github-action@main
with:
command: infer
- name: Bump chart versions
if: steps.nyx-infer.outputs.newVersion == 'true'
run: |
./.ci/utils/bump_version.sh ${{ steps.nyx-infer.outputs.version }} ${{ steps.nyx-infer.outputs.newRelease }}
- name: Render helm docs in CHART.md
if: steps.nyx-infer.outputs.newVersion == 'true'
run: |
./.ci/utils/helm_docs.sh
- name: Nyx make
uses: mooltiverse/nyx-github-action@main
if: steps.nyx-infer.outputs.newRelease == 'true'
with:
command: 'make'
# We only generate the release notes when a new release is published and it is a core version.
- name: Generate release notes
if: steps.nyx-infer.outputs.newRelease == 'true'
run: |
mv RELEASE_NOTES.md RELEASE_NOTES.old
cat CHANGELOG.md RELEASE_NOTES.old >> RELEASE_NOTES.md
rm RELEASE_NOTES.old
- name: Nyx publish
if: steps.nyx-infer.outputs.newVersion == 'true'
id: nyx-publish
uses: mooltiverse/nyx-github-action@main
with:
command: 'publish'
env:
GH_TOKEN: ${{ secrets.PAT }}
publish-chart:
# Avoid running when Nyx commits changes
if: ${{ !contains(github.event.head_commit.message, 'Release version') }}
name: Publish the chart
runs-on: ubuntu-latest
needs: release-version
steps:
- name: Release message
if: needs.release-version.outputs.newRelease == 'false'
run: echo "No new release to publish"
- name: Checkout
uses: actions/checkout@v4
if: needs.release-version.outputs.newRelease == 'true'
with:
fetch-depth: 0
ref: ${{ needs.release-version.outputs.version }}
- name: Configure Git
if: needs.release-version.outputs.newRelease == 'true'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Chart Releaser
if: needs.release-version.outputs.newRelease == 'true'
uses: helm/[email protected]
with:
install_only: true
version: v1.6.0
- name: Get repository name
if: needs.release-version.outputs.newRelease == 'true'
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Publish chart
if: needs.release-version.outputs.newRelease == 'true'
run: |
helm repo add minio https://charts.min.io/
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add loki https://grafana.github.io/helm-charts
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add redis https://charts.bitnami.com/bitnami
./.ci/utils/release_chart.sh
env:
REPOSITORY_OWNER: ${{ github.repository_owner }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}
GITHUB_TOKEN: ${{ secrets.PAT }}