Skip to content

Commit

Permalink
Fix #334, Add cache to all jobs
Browse files Browse the repository at this point in the history
Combine prep and build-cfs jobs
Rename jobs and artifacts for consistency and clarity
  • Loading branch information
astrogeco committed Sep 22, 2021
1 parent ea7db32 commit 1d60ed6
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 125 deletions.
104 changes: 41 additions & 63 deletions .github/workflows/build-cfs-deprecated.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Deprecated Build, Test, and Run"
name: Build, Test, and Run [OMIT_DEPRECATED = false]

# Run every time a new commit pushed or for pull requests
on:
Expand All @@ -25,23 +25,31 @@ jobs:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

prep-env:
name: Prepare Environment
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.

build-cfs:
name: Build
needs: check-for-duplicates
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}
key: deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: Checkout cFS
if: steps.cache-src-proto-bld.outputs.cache-hit != 'true'
if: steps.cache-src-bld.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
submodules: true
Expand All @@ -56,34 +64,12 @@ jobs:
- name: Prep Build
run: make prep

build-cfs:
name: Build
needs: prep-env
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

- name: Make
run: make
run: make install

test-cfs:
name: Test
tests-and-coverage:
name: Run Unit Tests and Check Coverage
needs: build-cfs
runs-on: ubuntu-18.04

Expand All @@ -101,19 +87,13 @@ jobs:
- name: Install Dependencies
run: sudo apt-get install lcov -y

- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Deprecated Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

- name: Prep Build
run: make prep

- name: Make
run: make

key: deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: Run Tests
run: make test

Expand All @@ -135,16 +115,13 @@ jobs:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Deprecated Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}
key: deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}

# Setup the build system
- name: Make Install
run: make install

- name: List cpu1
run: ls build/exe/cpu1/
Expand All @@ -159,7 +136,7 @@ jobs:
- name: Archive cFS Startup Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-startup-log-deprecate-true-${{ matrix.buildtype }}
name: cFS-startup-log-omit-deprecate-false${{ matrix.buildtype }}
path: ./build/exe/cpu1/cFS_startup_cpu1.txt

- name: Check for cFS Warnings
Expand All @@ -173,29 +150,30 @@ jobs:
working-directory: ./build/exe/cpu1/


Functional-Test-Build:
run-functional-test-app:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: build-cfs
needs: run-cfs
runs-on: ubuntu-18.04
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Deprecated Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

# Setup the build system
- name: Make Install
run: make install
key: deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: List cpu1
run: ls build/exe/cpu1/

# Run cFS, send commands to set perf trigger and start perf data, and run functional tests
- name: Run cFS Functional
- name: Run cFS Functional Tests
run: |
./core-cpu1 &
sleep 10
Expand All @@ -219,10 +197,10 @@ jobs:
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
working-directory: ./build/exe/cpu1/

- name: Archive cFS Startup Artifacts
- name: Archive Functional Test Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-functional-log-deprecate-true-${{ matrix.buildtype }}
name: cFS-functional-test-log-omit-deprecate-false-${{ matrix.buildtype }}
path: ./build/exe/cpu1/cf/cfe_test.log

- name: Check for cFS Warnings
Expand Down
102 changes: 40 additions & 62 deletions .github/workflows/build-cfs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Test, and Run [OMIT_DEPRECATED=true]
name: Build, Test, and Run [OMIT_DEPRECATED = true]

# Run every time a new commit pushed or for pull requests
on:
Expand All @@ -25,23 +25,31 @@ jobs:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

prep-env:
name: Prepare Environment
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.

build-cfs:
name: Build
needs: check-for-duplicates
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}
key: build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: Checkout cFS
if: steps.cache-src-proto-bld.outputs.cache-hit != 'true'
if: steps.cache-src-bld.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
submodules: true
Expand All @@ -55,34 +63,12 @@ jobs:
cp -r ./cfe/cmake/sample_defs sample_defs
- name: Prep Build
run: make prep

build-cfs:
name: Build
needs: prep-env
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

- name: Make
run: make
run: make install

test-cfs:
name: Test
tests-and-coverage:
name: Run Unit Tests and Check Coverage
needs: build-cfs
runs-on: ubuntu-18.04

Expand All @@ -100,19 +86,13 @@ jobs:
- name: Install Dependencies
run: sudo apt-get install lcov -y

- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

- name: Prep Build
run: make prep

- name: Make
run: make

key: build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: Run Tests
run: make test

Expand All @@ -134,16 +114,13 @@ jobs:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}
key: build-${{ github.run_number }}-${{ matrix.buildtype }}

# Setup the build system
- name: Make Install
run: make install

- name: List cpu1
run: ls build/exe/cpu1/
Expand All @@ -158,7 +135,7 @@ jobs:
- name: Archive cFS Startup Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-startup-log-deprecate-true-${{ matrix.buildtype }}
name: cFS-startup-log-omit-deprecate-true-${{ matrix.buildtype }}
path: ./build/exe/cpu1/cFS_startup_cpu1.txt

- name: Check for cFS Warnings
Expand All @@ -172,29 +149,30 @@ jobs:
working-directory: ./build/exe/cpu1/


Functional-Test-Build:
run-functional-test-app:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: build-cfs
needs: run-cfs
runs-on: ubuntu-18.04
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

steps:
- name: Cache Source and proto-build
id: cache-src-proto-bld
- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
key: proto-build-${{ github.run_number }}

# Setup the build system
- name: Make Install
run: make install
key: build-${{ github.run_number }}-${{ matrix.buildtype }}

- name: List cpu1
run: ls build/exe/cpu1/

# Run cFS, send commands to set perf trigger and start perf data, and run functional tests
- name: Run cFS Functional
- name: Run cFS Functional Tests
run: |
./core-cpu1 &
sleep 10
Expand All @@ -221,7 +199,7 @@ jobs:
- name: Archive cFS Startup Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-functional-log-deprecate-true-${{ matrix.buildtype }}
name: cFS-functional-test-log-omit-deprecate-true-${{ matrix.buildtype }}
path: ./build/exe/cpu1/cf/cfe_test.log

- name: Check for cFS Warnings
Expand Down

0 comments on commit 1d60ed6

Please sign in to comment.