chore: import upstream snapshot with attribution
Awesome CI Workflow / Code Formatter (push) Has been cancelled
Awesome CI Workflow / Compile checks (macOS-latest) (push) Has been cancelled
Awesome CI Workflow / Compile checks (ubuntu-latest) (push) Has been cancelled
Awesome CI Workflow / Compile checks (windows-latest) (push) Has been cancelled
Awesome CI Workflow / Code Formatter (push) Has been cancelled
Awesome CI Workflow / Compile checks (macOS-latest) (push) Has been cancelled
Awesome CI Workflow / Compile checks (ubuntu-latest) (push) Has been cancelled
Awesome CI Workflow / Compile checks (windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
on: pull_request_review
|
||||
name: Add "approved" label when approved
|
||||
permissions:
|
||||
pull-requests: write
|
||||
jobs:
|
||||
add_label:
|
||||
name: Add "approved" label when approved
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add "approved" label when approved
|
||||
uses: realstealthninja/label-when-approved@main
|
||||
with:
|
||||
approvals: 1
|
||||
secret: ${{ secrets.GITHUB_TOKEN }}
|
||||
label: "approved"
|
||||
@@ -0,0 +1,76 @@
|
||||
name: Awesome CI Workflow
|
||||
on: [push, pull_request]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
MainSequence:
|
||||
name: Code Formatter
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
- name: requirements
|
||||
run: |
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qq install clang-tidy clang-format
|
||||
# checks are passing with less errors when used with this version.
|
||||
# The default installs v6.0 which did not work out well in my tests
|
||||
- name: Setup Git Specs
|
||||
run: |
|
||||
git config --global user.name github-actions[bot]
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
- name: Filename Formatter
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/TheAlgorithms/scripts/main/filename_formatter.sh
|
||||
chmod +x filename_formatter.sh
|
||||
./filename_formatter.sh . .cpp,.hpp
|
||||
- name: Get file changes
|
||||
run: |
|
||||
git branch
|
||||
git diff --diff-filter=dr --name-only origin/master > git_diff.txt
|
||||
echo "Files changed-- `cat git_diff.txt`"
|
||||
- name: Configure for static lint checks
|
||||
# compiling first gives clang-tidy access to all the header files and settings used to compile the programs.
|
||||
# This will check for macros, if any, on linux and not for Windows. But the use of portability checks should
|
||||
# be able to catch any errors for other platforms.
|
||||
run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
- name: Lint modified files
|
||||
shell: bash
|
||||
run: python3 scripts/file_linter.py
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git diff DIRECTORY.md
|
||||
git commit -am "clang-format and clang-tidy fixes for ${GITHUB_SHA::8}" || true
|
||||
git push origin HEAD:$GITHUB_REF || true
|
||||
|
||||
build:
|
||||
name: Compile checks
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [MainSequence]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- run: |
|
||||
cmake -B ./build -S .
|
||||
cmake --build build --parallel 4
|
||||
- name: Label on PR fail
|
||||
uses: actions/github-script@v6
|
||||
if: ${{ failure() && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }}
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['automated tests are failing']
|
||||
})
|
||||
@@ -0,0 +1,61 @@
|
||||
name: "Code Scanning - Action"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: "30 1 * * 0"
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: cpp
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below).
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following
|
||||
# three lines and modify them (or add more) to build your code if your
|
||||
# project uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Directory writer
|
||||
on:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository == 'TheAlgorithms/C-Plus-Plus' # We only need this to run in our repository.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Build directory
|
||||
uses: TheAlgorithms/scripts/directory_md@main
|
||||
with:
|
||||
language: C-Plus-Plus
|
||||
working-directory: .
|
||||
filetypes: .cpp,.hpp,.h
|
||||
ignored-directories: doc/
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Doxygen CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Install requirements
|
||||
run: |
|
||||
brew install graphviz ninja doxygen
|
||||
- name: configure
|
||||
run: cmake -G Ninja -Duse_libclang=ON -DCMAKE_CXX_COMPILER=clang++ -B ./build -S .
|
||||
- name: build
|
||||
run: cmake --build build -t doc
|
||||
- name: gh-pages
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: "gh-pages"
|
||||
clean: false
|
||||
- name: Move & Commit files
|
||||
run: |
|
||||
git config --global user.name "$GITHUB_ACTOR"
|
||||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
|
||||
rm -rf d* && rm *.html && rm *.svg && rm *.map && rm *.md5 && rm *.png && rm *.js
|
||||
git add .
|
||||
cp -rp ./build/html/* . && rm -rf ./build && ls -lah
|
||||
git add .
|
||||
git commit -m "Documentation for $GITHUB_SHA" || true
|
||||
git push --force || true
|
||||
@@ -0,0 +1,18 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v4
|
||||
with:
|
||||
stale-issue-message: 'This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
close-issue-message: 'Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!'
|
||||
stale-pr-message: 'This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
close-pr-message: 'Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!'
|
||||
exempt-issue-labels: 'dont-close,approved'
|
||||
exempt-pr-labels: 'dont-close,approved'
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
Reference in New Issue
Block a user