Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr gh gcc problems test on my forked repo #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions .github/workflows/gcc-problems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
#######
# This pipeline runs various static analysis (e.g. GCC warnings) against the c / c++ pull requests.
#
# TODO: Move Docker container caching / storage to a repository
#
# TODO: Reduce workflow description duplication across jobs
# - Option: by use of Workflow Templates per gcc-build-target (need to move docker build to another workflow and requires container repo)
# - Option: by improving our build system and enabling faster build-all-targets
#######
name: "GCC Warnings & Errors"
on:
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- lte/gateway/c/**
- orc8r/gateway/c/**

# See [Example Sharing Container Between Jobs](https://github.com/docker/build-push-action/issues/225)
jobs:
gen_build_container:
runs-on: ubuntu-latest
steps:
-
name: Check Out Repo
uses: actions/checkout@v2
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Docker Build
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./lte/gateway/docker/mme/Dockerfile.ubuntu20.04
push: false
tags: magma/mme_builder:latest
outputs: type=docker,dest=/tmp/mme_builder.tar
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache - Fixup for buildx cache issue
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
-
name: Upload docker image for other jobs
uses: actions/upload-artifact@v2
with:
name: build_container
path: /tmp/mme_builder.tar

build_oai:
runs-on: ubuntu-latest
needs: gen_build_container
steps:
-
# This is necessary for overlays into the Docker container below.
name: Check Out Repo
uses: actions/checkout@v2
-
# I am using mmagician fork of get-changed-files (forked from jitterbit/get-changed-files)
# Rationale: our workflow (merge branch into upstream master) is incompatible
# See long list of GH Issues on https://github.com/jitterbit/get-changed-files w.r.t. head ahead of base
name: Fetch list of changed files
id: changed_files
uses: mmagician/get-changed-files@v2
with:
format: 'space-delimited'
-
name: Download docker image from generate_container_for_build
uses: actions/download-artifact@v2
with:
name: build_container
path: /tmp
-
name: Load Docker image
run: |
docker load --input /tmp/mme_builder.tar
docker image ls -a
-
# If needed https://github.com/microsoft/vscode-cpptools/issues/2266 for path fixups
#
# Additional GH Issues regarding paths for monorepos without root build.
# - https://github.com/actions/runner/issues/659
# - https://github.com/actions/runner/issues/765
#
# Paths emitted on warnings must be relative to the repository (e.g. lte/gateway/...),
# Therefore below I use `xo` to fixup our path emissions on gcc warnings.
uses: electronjoe/gcc-problem-matcher@v1
-
name: Build and Apply GCC Problem Matcher
uses: addnab/docker-run-action@v2
with:
image: magma/mme_builder:latest
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/magma -e ABC=123
run: |
cd /magma/lte/gateway/
make build_oai 2>&1 > /magma/compile.log
for file in ${{ steps.changed_files.outputs.all }};
do grep $file /magma/compile.log | xo '/\/magma\/((.*):(\d+):(\d+):\s+(?:fatal\s)?(warning|error):\s+(.*))/$1/' || true;
done;
-
name: Store build_logs_oai Artifact
uses: actions/upload-artifact@v2
with:
name: build_logs_oai
path: ${{ github.workspace }}/compile.log

build_session_manager:
runs-on: ubuntu-latest
needs: gen_build_container
steps:
-
# This is necessary for overlays into the Docker container below.
name: Check Out Repo
uses: actions/checkout@v2
-
# I am using mmagician fork of get-changed-files (forked from jitterbit/get-changed-files)
# Rationale: our workflow (merge branch into upstream master) is incompatible
# See long list of GH Issues on https://github.com/jitterbit/get-changed-files w.r.t. head ahead of base
name: Fetch list of changed files
id: changed_files
uses: mmagician/get-changed-files@v2
with:
format: 'space-delimited'
-
name: Download docker image from generate_container_for_build
uses: actions/download-artifact@v2
with:
name: build_container
path: /tmp
-
name: Load Docker image
run: |
docker load --input /tmp/mme_builder.tar
docker image ls -a
-
# If needed https://github.com/microsoft/vscode-cpptools/issues/2266 for path fixups
#
# Additional GH Issues regarding paths for monorepos without root build.
# - https://github.com/actions/runner/issues/659
# - https://github.com/actions/runner/issues/765
#
# Paths emitted on warnings must be relative to the repository (e.g. lte/gateway/...),
# Therefore below I use `xo` to fixup our path emissions on gcc warnings.
uses: electronjoe/gcc-problem-matcher@v1
-
name: Build and Apply GCC Problem Matcher
uses: addnab/docker-run-action@v2
with:
image: magma/mme_builder:latest
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/magma -e ABC=123
run: |
cd /magma/lte/gateway/
make build_session_manager 2>&1 > /magma/compile.log
for file in ${{ steps.changed_files.outputs.all }};
do grep $file /magma/compile.log | xo '/\/magma\/((.*):(\d+):(\d+):\s+(?:fatal\s)?(warning|error):\s+(.*))/$1/' || true;
done;
-
name: Store build_logs_session_manager Artifact
uses: actions/upload-artifact@v2
with:
name: build_logs_session_manager
path: ${{ github.workspace }}/compile.log
1 change: 1 addition & 0 deletions lte/gateway/c/oai/tasks/nas/emm/Attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ static void _create_new_attach_info(
int emm_proc_attach_request(
mme_ue_s1ap_id_t ue_id, const bool is_mm_ctx_new,
emm_attach_request_ies_t* const ies) {
int totally_useless = 1;
OAILOG_FUNC_IN(LOG_NAS_EMM);
int rc = RETURNerror;
ue_mm_context_t ue_ctx;
Expand Down
1 change: 1 addition & 0 deletions lte/gateway/c/session_manager/AAAClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace { // anonymous

aaa::terminate_session_request create_deactivate_req(
const std::string& radius_session_id, const std::string& imsi) {
int yet_another_unused_variable = 2;
aaa::terminate_session_request req;
req.set_radius_session_id(radius_session_id);
req.set_imsi(imsi);
Expand Down
Loading