|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | +# Copyright 2024 Intel Corporation |
| 3 | + |
| 4 | +name: Master workflow |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + pull_request: |
| 10 | + |
| 11 | +env: |
| 12 | + DOCKER_REPOSITORY: onosproject/ |
| 13 | + ONOS_SDCORE_ADAPTER_VERSION: latest |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - uses: actions/setup-go@v5 |
| 21 | + with: |
| 22 | + go-version-file: 'go.mod' |
| 23 | + - name: Build |
| 24 | + run: go build -o build/_output/aether-mock-exporter ./cmd/aether-mock-exporter |
| 25 | + |
| 26 | + lint: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: actions/setup-go@v5 |
| 31 | + with: |
| 32 | + go-version-file: 'go.mod' |
| 33 | + - uses: golangci/golangci-lint-action@v4.0.0 |
| 34 | + with: |
| 35 | + version: latest |
| 36 | + args: -v --config ./.golangci.yml --timeout=15m |
| 37 | + |
| 38 | + unit-tests: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + - uses: actions/setup-go@v5 |
| 43 | + with: |
| 44 | + go-version-file: 'go.mod' |
| 45 | + - name: Unit tests |
| 46 | + run: | |
| 47 | + go test -cover -race github.com/onosproject/aether-mock-exporter/pkg/... |
| 48 | + go test -cover -race github.com/onosproject/aether-mock-exporter/cmd/... |
| 49 | +
|
| 50 | + docker-build: |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - uses: actions/setup-go@v5 |
| 55 | + with: |
| 56 | + go-version-file: 'go.mod' |
| 57 | + - name: Build Docker image |
| 58 | + run: docker build . -f Dockerfile -t ${DOCKER_REPOSITORY}aether-mock-exporter:${ONOS_SDCORE_ADAPTER_VERSION} |
| 59 | + |
| 60 | + license-check: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - name: reuse lint |
| 65 | + uses: fsfe/reuse-action@v3 |
| 66 | + |
| 67 | + fossa-check: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - name: FOSSA scan |
| 72 | + uses: fossa-contrib/fossa-action@v3 |
| 73 | + with: |
| 74 | + fossa-api-key: 6d304c09a3ec097ba4517724e4a4d17d |
0 commit comments