Update master.yml #1
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
# SPDX-License-Identifier: Apache-2.0 | |
# Copyright 2023 Canonical Ltd. | |
name: Master workflow | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
types: [trigger-workflow] | |
jobs: | |
lint: | |
name: lint | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
version: latest | |
args: -v --config ./.golangci.yml | |
license-check: | |
runs-on: self-hosted | |
needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- name: reuse lint | |
uses: fsfe/reuse-action@v2 | |
fossa-check: | |
runs-on: self-hosted | |
needs: license-check | |
steps: | |
- uses: actions/checkout@v4 | |
- name: FOSSA scan | |
uses: fossa-contrib/fossa-action@v3 | |
with: | |
fossa-api-key: 0c3bbcdf20e157bbd487dae173751b28 | |
build: | |
runs-on: self-hosted | |
needs: fossa-check | |
# needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Build | |
run: go build | |
unit-tests: | |
runs-on: self-hosted | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Unit tests | |
run: go test ./... | |
docker-build: | |
runs-on: self-hosted | |
needs: unit-tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- uses: docker/[email protected] | |
- name: Build Docker image | |
run: make docker-build | |
- name: Log in to Docker Hub | |
run: echo "${{ secrets.PASSWORD }}" | docker login -u "${{ secrets.USERNAME }}" --password-stdin | |
- name: Tag Docker image | |
run: docker tag 5gc-udm:0.0.1-dev ashithacdac/udm_docker_repo | |
- name: Push Docker image to Docker Hub | |
run: docker push ashithacdac/udm_docker_repo |