Bump golang.org/x/net from 0.17.0 to 0.23.0 in /canary #168
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
name: Build Application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
application: [canary, zilch, service-kit] | |
include: | |
- os: ubuntu-latest | |
go-version: 1.20.x | |
- package: true | |
- application: service-kit | |
package: false | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}-${{ matrix.application }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Test | |
working-directory: ${{ matrix.application }} | |
run: go test -v ./... -coverprofile=cover.out | |
- name: Golangci Lint | |
working-directory: ${{ matrix.application }} | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1 | |
golangci-lint run --out-format checkstyle -D deadcode,unused --build-tags=integration --timeout 10m --issues-exit-code 0 ./... | tee lint-report.xml | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@v2.1.1 | |
with: | |
projectBaseDir: ${{ matrix.application }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2.2.0 | |
if: ${{ matrix.application == true }} | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4.6.0 | |
if: ${{ matrix.application == true }} | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch | |
type=ref,enable=true,priority=600,prefix=,suffix=,event=tag | |
type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4.1.1 | |
if: ${{ matrix.application == true }} | |
with: | |
context: ${{ matrix.application }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |