Skip to content

Add Support for Github Actions CI #118

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
69 changes: 69 additions & 0 deletions .github/workflows/dce-gaction-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: DCE Build
on: [push, pull_request]

# Anchors are not supported, so could not make use of modular workflow

jobs :
build:
strategy:
matrix:
job:
# Used a personal Ubuntu-16.04 docker image since the previous once defaulted to root user,
# so had to prefix all commands with sudo, and Github actions like checkout and caching throws permission error
# [ 'job-name' , 'docker-image-name' ]
# [ 'ubuntu-16.04', 'parthpratim27/ns-3-dce:ubuntu-16.04' ]
- [ 'ubuntu-20.04', 'parthpratim27/ns-3-dce:ubuntu-20.04' ]

name : ${{ matrix.job[0] }}
runs-on : ubuntu-20.04 # This is ignored, but is a required field so is being set to this
container: ${{ matrix.job[1] }}

env:
BAKE_GIT: 'https://gitlab.com/nsnam/bake.git'
BAKE_CONFIG: 'dce-linux-dev' # list-type, for each entry, -e {bake_config_entry} ... , will be added
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToDo: Add delimiter based dynamic configuration for bake

GIT_HEAD_TRACK : '.git/HEAD'
HG_CHANGE_LOG : '.hg/store/00changelog.i'

steps:
- name: Pull Source Tree
uses: actions/checkout@v2
with:
path : target-dce-repo

- name: Download Bake
run: git clone $BAKE_GIT bake

- name: Configure Bake
run: ./bake/bake.py configure -e $BAKE_CONFIG

- name: Download all required repos
run: ./bake/bake.py download -vvv

- name: Copy Current ${{ github.event_name }} to source/ns-3-dce
run: cp -a target-dce-repo/. source/ns-3-dce

# Below Caching saves 16 mins of build time (if an ns-3-dev build with same HEAD already exists)
# Couldn't add the same for net-next-nuse-4.4.0, because it would anyways still build the entire project after defconfig
- name: Load Build Cache for ns-3-dev
uses: actions/cache@v2
with:
id : cache-ns-3-dev
path: source/ns-3-dev
key: ${{ matrix.job[0] }}-src-build-ns-3-dev-${{ hashFiles('source/ns-3-dev/.git/HEAD') }}

- name: Build Bake
run: ./bake/bake.py build -vvv

- name: Run Tests
run: |
cd source/ns-3-dce && ./test.py -r
find "testpy-output/" -type s -exec rm -f {} \;

- name: Save Test Output Artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ github.job }}-test-py-output
path: source/ns-3-dce/testpy-output



1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Github Actions Build Status](https://github.com/ParthPratim/ns-3-dce/workflows/DCE%20Build/badge.svg)](https://github.com/ParthPratim/ns-3-dce/actions)
[![Build status](https://circleci.com/gh/direct-code-execution/ns-3-dce.svg?style=shield&circle-token=a9cf0c7e5e7a1d1a7ff2e2e5b341706fba3ccfb2)](https://circleci.com/gh/direct-code-execution/ns-3-dce)
[![Documentation Status](https://readthedocs.org/projects/ns-3-dce/badge/?version=latest)](http://ns-3-dce.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/license-GPL-brightgreen.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
Expand Down