|
| 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 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - uses: actions/setup-go@v5 |
| 17 | + with: |
| 18 | + go-version-file: 'go.mod' |
| 19 | + - name: Build |
| 20 | + run: go build -o build/_output/onos-e2t ./cmd/onos-e2t |
| 21 | + |
| 22 | + lint: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: actions/setup-go@v5 |
| 27 | + with: |
| 28 | + go-version-file: 'go.mod' |
| 29 | + - uses: golangci/golangci-lint-action@v4.0.0 |
| 30 | + with: |
| 31 | + version: latest |
| 32 | + args: -v --config ./.golangci.yml |
| 33 | + |
| 34 | + unit-tests: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: actions/setup-go@v5 |
| 39 | + with: |
| 40 | + go-version-file: 'go.mod' |
| 41 | + - name: Unit tests |
| 42 | + run: go test -race github.com/onosproject/onos-e2t/... |
| 43 | + |
| 44 | + docker-build: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - uses: actions/setup-go@v5 |
| 49 | + with: |
| 50 | + go-version-file: 'go.mod' |
| 51 | + - name: Build Docker image |
| 52 | + run: | |
| 53 | + git clone https://github.com/onosproject/build-tools.git build/build-tools |
| 54 | + go mod vendor |
| 55 | + docker build . -f build/onos-e2t/Dockerfile -t onosproject/onos-e2t:latest |
| 56 | + rm -rf vendor |
| 57 | +
|
| 58 | + buflint: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + - name: buflint |
| 63 | + env: |
| 64 | + BUF_VERSION: 1.0.0 |
| 65 | + run: | |
| 66 | + cd .. |
| 67 | + git clone https://github.com/onosproject/onos-lib-go.git |
| 68 | + cd onos-e2t |
| 69 | + docker run \ |
| 70 | + -v `pwd`:/go/src/github.com/onosproject/onos-e2t \ |
| 71 | + -v `pwd`/../onos-lib-go/api/asn1:/go/src/github.com/onosproject/onos-e2t/api/asn1 \ |
| 72 | + -w /go/src/github.com/onosproject/onos-e2t/api \ |
| 73 | + bufbuild/buf:$BUF_VERSION lint --path e2ap |
| 74 | +
|
| 75 | + license-check: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + - name: reuse lint |
| 80 | + uses: fsfe/reuse-action@v2 |
| 81 | + |
| 82 | + fossa-check: |
| 83 | + runs-on: ubuntu-latest |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v4 |
| 86 | + - name: FOSSA scan |
| 87 | + uses: fossa-contrib/fossa-action@v3 |
| 88 | + with: |
| 89 | + fossa-api-key: 6d304c09a3ec097ba4517724e4a4d17d |
0 commit comments