Merge pull request #6 from TheAlgorithms/master

Awesome CI workflow
This commit is contained in:
Ayaan Khan
2020-06-21 00:09:35 +05:30
committed by GitHub

View File

@@ -1,23 +1,22 @@
name: Awesome CI Workflow
on: [push]
on: [push, pull_request]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
code_format:
MainSequence:
name: Code Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1 # v2 is broken for git diff
- uses: actions/setup-python@v2
- name: requirements
run: |
sudo apt -qq -y update
sudo apt -qq install clang-format
- uses: actions/checkout@master
with:
submodules: true
sudo apt -qq install clang-format
- name: Setup Git Specs
run: |
git config --global user.name github-actions
@@ -56,18 +55,7 @@ jobs:
line2: "IndentWidth: 4, TabWidth: 4, "
line3: "AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false,"
line4: "ColumnLimit: 80, AccessModifierOffset: -3 }"
- name: Git Push
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
shell: python
run: |
@@ -121,32 +109,14 @@ jobs:
git add DIRECTORY.md
git commit -am "updating DIRECTORY.md" || true
git push --force origin HEAD:$GITHUB_REF || true
# cpplint:
# name: CPPLINT
# needs: code_format
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - uses: actions/setup-python@master
# - run: pip install cpplint
# - run: git pull
# - run: cpplint --filter=-legal --recursive .
cpplint_modified_files:
runs-on: ubuntu-latest
needs: code_format
name: CPPLINT
steps:
- uses: actions/checkout@master # v2 is broken for git diff
- uses: actions/setup-python@master
- run: python -m pip install cpplint
- run: git remote -v
- run: git branch
- run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- run: git pull
- run: git diff --diff-filter=dr --name-only origin/master > git_diff.txt
- run: echo "Files changed-- `cat git_diff.txt`"
- name: Install CPPLINT
run: |
python -m pip install cpplint
git remote -v
git branch
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git diff --diff-filter=dr --name-only origin/master > git_diff.txt
echo "Files changed-- `cat git_diff.txt`"
- name: cpplint_modified_files
shell: python
run: |
@@ -197,8 +167,7 @@ jobs:
build:
name: Compile checks
runs-on: ${{ matrix.os }}
# needs: [cpplint, update_directory_md, cpplint_modified_files]
needs: [update_directory_md]
needs: [MainSequence]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
@@ -206,6 +175,5 @@ jobs:
- uses: actions/checkout@master
with:
submodules: true
- run: git pull
- run: cmake -B ./build -S .
- run: cmake --build build