Skip to content

Update prSizeLabeler.yaml #131

Update prSizeLabeler.yaml

Update prSizeLabeler.yaml #131

Workflow file for this run

name: CI/CD master
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
jobs:
initial:
name: Initializing
runs-on: ${{ matrix.platform }}
strategy:
matrix:
go-version: ['1.18.x', '1.19', '1.20']
platform: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Go modules Cache
uses: actions/cache@v3
id: go-cache
with:
path: ~/go/pkg/mod
#key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- if: steps.go-cache.outputs.cache-hit != 'true'
run: go mod download
- name: Test
run: go test -race ./...
- name: Build
working-directory: ./app/cmd/main
run: go build -v -o app-${{ matrix.go-version }}
- name: Upload Build results
uses: actions/upload-artifact@v3
with:
name: Go-results-${{ matrix.go-version }}
path: ./app/cmd/main/app-${{ matrix.go-version }}
docker-check-vulnerabilities:
runs-on: ubuntu-latest
needs: initial
steps:
- uses: actions/checkout@v3
- name: Checkov Dockerfile Scan
uses: bridgecrewio/[email protected]
with:
directory: .
framework: dockerfile
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
docker:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: docker-check-vulnerabilities
steps:
- uses: actions/checkout@v3
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: Go-results-1.19
- shell: bash
run: |
mv app-1.19 albums
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: arturmon/albums:latest
cache-from: type=gha
cache-to: type=gha,mode=max