Skip to content

Commit 671d450

Browse files
authored
Merge pull request #108 from arielswalker/part-cfs/workflows#122-add-internal-workflows
Part cFS/workflows#122, Add Internal Workflows
2 parents 680fe45 + a4549fc commit 671d450

4 files changed

Lines changed: 88 additions & 19 deletions

File tree

.github/actions/setup-osal/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
using: 'composite'
2020
steps:
2121
- name: Checkout OSAL
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
repository: ${{ inputs.upstream-repo }}
2525
ref: ${{ inputs.upstream-ref }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Add Issue or PR to Project
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened, ready_for_review, converted_to_draft]
8+
9+
jobs:
10+
add-to-project:
11+
name: Add issue or pull request to project
12+
uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev
13+
secrets: inherit

.github/workflows/static-analysis.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
12
name: Static Analysis
23

3-
# Run on all push and pull requests
4+
# Run on pull requests and by dispatch
45
on:
56
push:
67
branches:
@@ -13,8 +14,50 @@ on:
1314
- synchronize
1415
workflow_dispatch:
1516

17+
# Force bash to apply pipefail option so pipeline failures aren't masked
18+
defaults:
19+
run:
20+
shell: bash
21+
1622
jobs:
23+
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
24+
checks-for-duplicates:
25+
runs-on: ubuntu-latest
26+
# Map a step output to a job output
27+
outputs:
28+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
29+
steps:
30+
- id: skip_check
31+
uses: fkirc/skip-duplicate-actions@master
32+
with:
33+
concurrent_skipping: 'same_content'
34+
skip_after_successful_duplicate: 'true'
35+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
1736

1837
static-analysis:
1938
name: Run cppcheck
20-
uses: nasa/cFS/.github/workflows/static-analysis.yml@main
39+
needs: checks-for-duplicates
40+
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }}
41+
runs-on: ubuntu-latest
42+
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
43+
44+
strategy:
45+
fail-fast: false
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v5
50+
with:
51+
path: source
52+
53+
- name: CMake Setup
54+
run: |
55+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DENABLE_UNIT_TESTS=FALSE -B build -S source
56+
- name: Run general cppcheck
57+
run: cppcheck --force --inline-suppr --xml --project=build/compile_commands.json 2> cppcheck_err.xml
58+
59+
- name: Convert cppcheck results to Markdown
60+
run: xsltproc source/.github/scripts/cppcheck-output.xslt cppcheck_err.xml | tee $GITHUB_STEP_SUMMARY cppcheck_err.txt
61+
62+
- name: Check for reported errors
63+
run: tail -n 1 cppcheck_err.txt | grep -q '^\*\*0 error(s) reported\*\*$'

.github/workflows/validation-test.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Internal Build And Run EdsLib Validation Tests
1+
name: Build And Run EdsLib Validation Tests
22

33
on:
44
push:
@@ -19,30 +19,46 @@ defaults:
1919

2020
env:
2121
UPSTREAM_OSAL_REPO: nasa/osal
22-
UPSTREAM_OSAL_REF: main
22+
UPSTREAM_OSAL_REF: dev
2323

2424
jobs:
25+
checks-for-duplicates:
26+
runs-on: ubuntu-latest
27+
# Map a step output to a job output
28+
outputs:
29+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
30+
steps:
31+
- id: skip_check
32+
uses: fkirc/skip-duplicate-actions@master
33+
with:
34+
concurrent_skipping: 'same_content'
35+
skip_after_successful_duplicate: 'true'
36+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
37+
2538
prepare-dependencies:
2639
name: Prepare Dependencies
2740
runs-on: ubuntu-latest
41+
needs: checks-for-duplicates
42+
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }}
43+
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
2844
steps:
2945
- name: Cache EdsLib Source
30-
uses: actions/cache@v3
46+
uses: actions/cache@v5
3147
id: cache-edslib
3248
with:
3349
path: ${{ github.workspace }}/source
3450
key: edslib-source-${{ github.sha }}
3551

3652
- name: Cache OSAL Dependency
37-
uses: actions/cache@v3
53+
uses: actions/cache@v5
3854
id: cache-osal
3955
with:
4056
path: ${{ github.workspace }}/osal-staging
4157
key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }}
4258

4359
- name: Checkout EdsLib
4460
if: steps.cache-edslib.outputs.cache-hit != 'True'
45-
uses: actions/checkout@v4
61+
uses: actions/checkout@v5
4662
with:
4763
path: source
4864

@@ -57,7 +73,8 @@ jobs:
5773
build-and-test:
5874
name: Build EdsLib and Execute Tests
5975
needs: [prepare-dependencies]
60-
runs-on: ubuntu-latest
76+
runs-on: ubuntu-latest
77+
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
6178

6279
strategy:
6380
fail-fast: false
@@ -69,20 +86,17 @@ jobs:
6986

7087
steps:
7188

72-
- name: Install Build Dependencies
73-
run: sudo apt-get install liblua5.4-dev libpython3-dev libjson-c-dev pkg-config lcov xsltproc -y
74-
7589
# Note - caches were updated in "prepare-dependencies" job so all three of these should be a hit
7690
- name: Retrieve Cached EdsLib Source
77-
uses: actions/cache@v3
91+
uses: actions/cache@v5
7892
id: restore-source
7993
with:
8094
path: ${{ github.workspace }}/source
8195
key: edslib-source-${{ github.sha }}
8296

8397
- name: Retrieve Cached OSAL Dependency
8498
id: restore-osal
85-
uses: actions/cache@v3
99+
uses: actions/cache@v5
86100
with:
87101
path: ${{ github.workspace }}/osal-staging
88102
key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }}
@@ -91,11 +105,10 @@ jobs:
91105
# so in order to make this work it needs to adjust this.
92106
- name: Import OSAL
93107
run: |
94-
sudo find ${GITHUB_WORKSPACE}/osal-staging -type d -print0 | xargs -0 chmod go+rx
95-
sudo find ${GITHUB_WORKSPACE}/osal-staging -type f -print0 | xargs -0 chmod go+r
96-
sudo find ${GITHUB_WORKSPACE}/osal-staging -type f -path '*/bin/*' -print0 | xargs -0 chmod go+x
97108
sudo cp -rv -t / ${GITHUB_WORKSPACE}/osal-staging/*
98-
109+
sudo find /usr/local -type d -exec chmod go+rx {} \;
110+
sudo find /usr/local -type f -exec chmod go+r {} \;
111+
sudo find /usr/local -type f -path '*/bin/*' -exec chmod go+x {} \;
99112
- name: Refresh Dynamic Linker Cache
100113
run: sudo ldconfig
101114

@@ -135,4 +148,4 @@ jobs:
135148
fi
136149
if [ -s '${{ env.MATRIX_ID }}/lcov-summary.xml' ]; then
137150
cat '${{ env.MATRIX_ID }}/lcov-summary.xml' >> $GITHUB_STEP_SUMMARY
138-
fi
151+
fi

0 commit comments

Comments
 (0)