Skip to content

svc (#19)

svc (#19) #66

name: Service Build and Release
on:
push:
branches: [trunk]
paths:
- '.github/workflows/svc-build-release.yml'
- '.github/deploy/svc-values.yml'
- 'scheduler/**/*.go'
- 'scheduler/Dockerfile'
- 'scheduler/go.mod'
- 'scheduler/go.sum'
pull_request:
branches: [trunk]
paths:
- '.github/workflows/svc-build-release.yml'
- '.github/deploy/svc-values.yml'
- 'scheduler/**/*.go'
- 'scheduler/Dockerfile'
- 'scheduler/go.mod'
- 'scheduler/go.sum'
env:
PROJECT_PATH: 'scheduler'
SYSTEM_NAME: 'ice'
APPLICATION_NAME: 'scheduler'
PROJECT_FILE: 'go.mod'
HELM_VALUES_FILE: '.github/deploy/svc-values.yml'
jobs:
analyze:
name: Analyze
runs-on: elvia-runner
permissions:
actions: read
contents: read
security-events: write
# Limits the number of concurrent runs of this job to one, and cancels any in progress.
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}-analyze'
cancel-in-progress: true
steps:
- uses: 3lvia/core-github-actions-templates/analyze@trunk
with:
working-directory: ${{ env.PROJECT_PATH }}
language: 'go'
test:
name: Test
runs-on: elvia-runner
strategy:
matrix:
go-version: [ '1.24.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: ${{ env.PROJECT_PATH }}/go.sum
- name: Test with Go
run: |
cd ${{ env.PROJECT_PATH }}
go test -v ./... -json > TestResults-${{ matrix.go-version }}.json
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: Go-results-${{ matrix.go-version }}
path: ${{ env.PROJECT_PATH }}/TestResults-${{ matrix.go-version }}.json
build-scan:
name: Build and Scan
runs-on: elvia-runner
permissions:
actions: read
contents: write
id-token: write
pull-requests: write
security-events: write
# Limits the number of concurrent runs of this job to one, and cancels any in progress.
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}-build-scan'
cancel-in-progress: true
environment: build
steps:
- uses: 3lvia/core-github-actions-templates/build@trunk
with:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_PATH }}/${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
deploy-dev:
name: Deploy Dev
needs:
- analyze
- test
- build-scan
runs-on: elvia-runner
permissions:
contents: read
id-token: write
# Limits the number of concurrent runs of this job to one, but DOES NOT cancel any in progress.
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}-deploy-dev'
environment: dev
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
# slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
AZURE_CLIENT_ID: ${{ vars.AKS_CLIENT_ID }}