mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-25 06:49:36 +03:00
fixed Github actions CI workflow
to mimic changes in C++ repo
This commit is contained in:
parent
10122ed784
commit
b1d92cbdda
24
.github/workflows/awesome_workflow.yml
vendored
24
.github/workflows/awesome_workflow.yml
vendored
@ -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
|
||||
- name: Setup Git Specs
|
||||
run: |
|
||||
git config --global user.name github-actions
|
||||
@ -38,7 +37,7 @@ jobs:
|
||||
if [ ${fname} != ${new_fname} ]
|
||||
then
|
||||
echo " ${fname} --> ${new_fname}"
|
||||
git "mv" "-f" "${fname}" "${new_fname}"
|
||||
git "mv" "${fname}" ${new_fname}
|
||||
fi
|
||||
done
|
||||
git commit -am "formatting filenames $GITHUB_SHA" || true
|
||||
@ -48,6 +47,7 @@ jobs:
|
||||
do
|
||||
clang-format --verbose -i --style="$line1 $line2 $line3 $line4" "$fname"
|
||||
done
|
||||
git commit -am "formatting source-code for $GITHUB_SHA" || true
|
||||
env:
|
||||
line1: "{ BasedOnStyle: LLVM, UseTab: Never,"
|
||||
line2: "IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman,"
|
||||
@ -56,15 +56,6 @@ jobs:
|
||||
- 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: |
|
||||
@ -122,7 +113,7 @@ jobs:
|
||||
build:
|
||||
name: Compile checks
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [update_directory_md]
|
||||
needs: [MainSequence]
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
@ -130,6 +121,5 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
submodules: true
|
||||
- run: git pull
|
||||
- run: cmake -B ./build -S .
|
||||
- run: cmake --build build
|
||||
|
Loading…
Reference in New Issue
Block a user