Skip to content

Commit

Permalink
Fix #138, Add Build Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arielswalker committed Jan 25, 2022
1 parent 3b8e512 commit 9c7ff9f
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build-cfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build and Run [OMIT_DEPRECATED = true]

# Run every time a new commit pushed or for pull requests
on:
push:
pull_request:

env:
SIMULATION: native
OMIT_DEPRECATED: true
ENABLE_UNIT_TESTS: false

jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
check-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

build-run:
needs: check-for-duplicates
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-18.04
timeout-minutes: 15

steps:
- name: Checkout bundle
uses: actions/checkout@v2
with:
repository: nasa/cFS
submodules: true

- name: Checkout bundle
uses: actions/checkout@v2
with:
path: apps/CF

- name: Check versions
run: git submodule

- name: Add CF app
run: |
sed -i '7i CFE_APP, CF, CF_AppMain, CF_APP, 80, 16384, 0x0, 0; \n' cfe/cmake/sample_defs/cpu1_cfe_es_startup.scr
sed -i -e 's|SET(cpu1_APPLIST ci_lab to_lab sch_lab)| SET(cpu1_APPLIST ci_lab to_lab sch_lab CF) |g' cfe/cmake/sample_defs/targets.cmake
sed -i -e 's|add_cfe_tables(cf fsw/tables/cf_def_config.c)| add_cfe_tables(CF fsw/tables/cf_def_config.c) |g' apps/CF/CMakeLists.txt
sed -i -e 's|add_cfe_app(cf ${APP_SRC_FILES})| add_cfe_app(CF ${APP_SRC_FILES}) |g' apps/CF/CMakeLists.txt
- name: Set up for build
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
- name: Prep Build
run: make prep

- name: Make Install
run: make install

- name: Run cFS
run: |
./core-cpu1 > cFS_startup_cpu1.txt &
sleep 30
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
working-directory: ./build/exe/cpu1/

- name: Archive cFS Startup Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-startup-log-omit-deprecate-true
path: ./build/exe/cpu1/cFS_startup_cpu1.txt

- name: Check for cFS Warnings
run: |
if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then
echo "Must resolve warn|err|fail in cFS startup before submitting a pull request"
echo ""
grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt
exit -1
fi
working-directory: ./build/exe/cpu1/

0 comments on commit 9c7ff9f

Please sign in to comment.