fixed Github actions CI workflow

to mimic changes in C++ repo
This commit is contained in:
Krishna Vedala 2020-06-20 07:27:19 -04:00
parent 10122ed784
commit b1d92cbdda
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -1,23 +1,22 @@
name: Awesome CI Workflow name: Awesome CI Workflow
on: [push] on: [push, pull_request]
# push: # push:
# branches: [ master ] # branches: [ master ]
# pull_request: # pull_request:
# branches: [ master ] # branches: [ master ]
jobs: jobs:
code_format: MainSequence:
name: Code Formatter name: Code Formatter
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 # v2 is broken for git diff
- uses: actions/setup-python@v2
- name: requirements - name: requirements
run: | run: |
sudo apt -qq -y update sudo apt -qq -y update
sudo apt -qq install clang-format sudo apt -qq install clang-format
- uses: actions/checkout@master
with:
submodules: true
- name: Setup Git Specs - name: Setup Git Specs
run: | run: |
git config --global user.name github-actions git config --global user.name github-actions
@ -38,7 +37,7 @@ jobs:
if [ ${fname} != ${new_fname} ] if [ ${fname} != ${new_fname} ]
then then
echo " ${fname} --> ${new_fname}" echo " ${fname} --> ${new_fname}"
git "mv" "-f" "${fname}" "${new_fname}" git "mv" "${fname}" ${new_fname}
fi fi
done done
git commit -am "formatting filenames $GITHUB_SHA" || true git commit -am "formatting filenames $GITHUB_SHA" || true
@ -48,6 +47,7 @@ jobs:
do do
clang-format --verbose -i --style="$line1 $line2 $line3 $line4" "$fname" clang-format --verbose -i --style="$line1 $line2 $line3 $line4" "$fname"
done done
git commit -am "formatting source-code for $GITHUB_SHA" || true
env: env:
line1: "{ BasedOnStyle: LLVM, UseTab: Never," line1: "{ BasedOnStyle: LLVM, UseTab: Never,"
line2: "IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman," line2: "IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman,"
@ -56,15 +56,6 @@ jobs:
- name: Git Push - name: Git Push
run: git push --force origin HEAD:$GITHUB_REF || true run: git push --force origin HEAD:$GITHUB_REF || true
update_directory_md:
name: Update Directory.md
needs: code_format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- name: pull latest commit
run: git pull
- name: Update DIRECTORY.md - name: Update DIRECTORY.md
shell: python shell: python
run: | run: |
@ -122,7 +113,7 @@ jobs:
build: build:
name: Compile checks name: Compile checks
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: [update_directory_md] needs: [MainSequence]
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-latest]
@ -130,6 +121,5 @@ jobs:
- uses: actions/checkout@master - uses: actions/checkout@master
with: with:
submodules: true submodules: true
- run: git pull
- run: cmake -B ./build -S . - run: cmake -B ./build -S .
- run: cmake --build build - run: cmake --build build