Skip to content

Updated workflows for UPF #2

Updated workflows for UPF

Updated workflows for UPF #2

Workflow file for this run

# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Canonical Ltd.
# Copyright 2024 Intel Corporation
name: CDAC Master workflow
on:
pull_request:
branches:
- cdacmaster
push:
branches:
- cdacmaster
workflow_dispatch:
jobs:
#build:
#if: github.event_name == 'pull_request'
#runs-on: ubuntu-latest
#steps:
#- uses: actions/checkout@v4
#- uses: actions/setup-go@v5
# with:
# go-version-file: 'go.mod'
# - name: Generate protobuf
# run: make pb
# - name: Build the BESS-UPF Docker image
# run: DOCKER_TARGETS=bess make docker-build
#- name: Build the PFCP Agent Docker image
# run: DOCKER_TARGETS=pfcpiface make docker-build
lint:
name: lint
runs-on: ubuntu-latest
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 --timeout=10m
hadolint:
name: hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Dockerfile linter
uses: hadolint/[email protected]
# For now, ignoring:
# DL3007 warning: Pin the version explicitily to a release tag (no latest);
# DL3008 warning: Pin versions in apt get install (e.g., apt-get install <package>=<version>); and
# DL3018 warning: Pin versions in apk add (e.g., apk add <package>=<version>)
with:
dockerfile: Dockerfile
ignore: DL3007,DL3008,DL3018
check-spelling:
name: Markdown spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Spelling
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
route-control-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create virtual environment
run: python -m venv venv
- name: Install dependencies
run: |
source ./venv/bin/activate
pip install -r requirements.txt
- name: Run tests
run: |
source ./venv/bin/activate
python -m unittest ./conf/test_route_control.py
- name: Clean up virtual environment
run: rm -rf venv
unit-tests-pfcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run unit tests for PFCP Agent
run: make test
integration-tests-up4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run integration tests for PFCP Agent & UP4
run: make test-up4-integration-docker || (docker logs pfcpiface; exit 1)
integration-tests-bess:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run integration tests for PFCP Agent & UP4
run: make test-bess-integration-native
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: reuse lint
uses: fsfe/reuse-action@v3
fossa-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: FOSSA scan
uses: fossa-contrib/fossa-action@v3
with:
fossa-api-key: 0c3bbcdf20e157bbd487dae173751b28
docker-build-push-images:
runs-on: ubuntu-latest
needs: [route-control-tests, unit-tests-pfcp, integration-tests-up4, integration-tests-bess]
env:
REGISTRY: docker.io
DOCKER_REGISTRY: docker.io/
DOCKER_REPOSITORY: cdac5gc/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DCKRUSER }}
password: ${{ secrets.DCKRPASS }}
- name: Build and push release Docker image
env:
DOCKER_TAG: rel-${{ needs.tag-github.outputs.version }}-haswell
CPU: haswell
run: |
CPU=$CPU make docker-build
make docker-push
- name: Build and push release Docker image for Ivybridge CPU
env:
DOCKER_TAG: rel-${{ needs.tag-github.outputs.version }}-ivybridge
CPU: ivybridge
run: |
CPU=$CPU make docker-build
make docker-push