Skip to content

Commit

Permalink
Merge pull request #245 from skliper/fix230-workflow_updates
Browse files Browse the repository at this point in the history
Fix #230, Add workflow timeout and format check
  • Loading branch information
astrogeco authored Feb 12, 2021
2 parents 064f62b + 377246a commit 6cc9cda
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 30 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Format Check

# Run on main push and pull requests
on:
push:
branches:
- main
pull_request:

jobs:

static-analysis:
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
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
static-analysis:
name: Run cppcheck
runs-on: ubuntu-18.04
timeout-minutes: 15

strategy:
fail-fast: false
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Travis-CI: [![Build Status](https://travis-ci.com/nasa/PSP.svg)](https://travis-ci.com/nasa/PSP)
![Static Analysis](https://github.com/nasa/psp/workflows/Static%20Analysis/badge.svg)
![Format Check](https://github.com/nasa/psp/workflows/Format%20Check/badge.svg)

# Core Flight System : Framework : Platform Support Package

Expand Down

0 comments on commit 6cc9cda

Please sign in to comment.