-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from ArielSAdamsNASA/fix-96-reuse-workflows
Fix #96, Reuse CodeQL, Static Analysis, and Format Check
- Loading branch information
Showing
3 changed files
with
11 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,11 @@ | ||
name: Format Check | ||
|
||
# Run on main push and pull requests | ||
# Run on all push and pull requests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
|
||
static-analysis: | ||
format-check: | ||
name: Run format check | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
|
||
- name: Install format checker | ||
run: | | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | ||
sudo apt-get update && sudo apt-get install clang-format-10 | ||
- name: Checkout bundle | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: nasa/cFS | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: repo | ||
|
||
- name: Generate format differences | ||
run: | | ||
cd repo | ||
find . -name "*.[ch]" -exec clang-format-10 -i -style=file {} + | ||
git diff > $GITHUB_WORKSPACE/style_differences.txt | ||
- name: Archive Static Analysis Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: style_differences | ||
path: style_differences.txt | ||
|
||
- name: Error on differences | ||
run: | | ||
if [[ -s style_differences.txt ]]; | ||
then | ||
cat style_differences.txt | ||
exit -1 | ||
fi | ||
uses: nasa/cFS/.github/workflows/format-check.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,12 @@ | ||
name: Static Analysis | ||
|
||
# Run on main push and pull requests | ||
# Run on all push and pull requests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
|
||
static-analysis: | ||
name: Run cppcheck | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
|
||
- name: Install cppcheck | ||
run: sudo apt-get install cppcheck -y | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run general cppcheck | ||
run: cppcheck --force --inline-suppr --quiet . 2> cppcheck_err.txt | ||
|
||
- name: Archive Static Analysis Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cppcheck-err | ||
path: ./cppcheck_err.txt | ||
|
||
- name: Check for errors | ||
run: | | ||
if [[ -s cppcheck_err.txt ]]; | ||
then | ||
cat cppcheck_err.txt | ||
exit -1 | ||
fi | ||
uses: nasa/cFS/.github/workflows/static-analysis.yml@main |