From 1485a39f88b5314883c0bfb1ba422937612e5e8f Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 22:48:13 +0530 Subject: [PATCH 1/9] added yml for programming languages --- .github/workflows/jsBuild.yml | 23 +++++++++++++++++++++++ sonar-project.properties | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/jsBuild.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/jsBuild.yml b/.github/workflows/jsBuild.yml new file mode 100644 index 0000000..6c527fc --- /dev/null +++ b/.github/workflows/jsBuild.yml @@ -0,0 +1,23 @@ +name: Build +on: + push: + branches: + - main + paths: + - "JavaScript/**" + - ".github/workflows/jsBuild.yml" + pull_request: + types: [opened, synchronize, reopened] +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..3129afa --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=dev-madhurendra_OOPs +sonar.organization=dev-madhurendra + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=OOPs +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 \ No newline at end of file From 2710412f30249173e76b8e732b3cf9d316d436c7 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:00:06 +0530 Subject: [PATCH 2/9] added workflows for c++ and approved --- .github/workflows/approved-label.yml | 14 ++++++ .github/workflows/codeql.yml | 64 ++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/approved-label.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml new file mode 100644 index 0000000..ce48ded --- /dev/null +++ b/.github/workflows/approved-label.yml @@ -0,0 +1,14 @@ +on: pull_request_review +name: Add "approved" label when approved +jobs: + add_label: + name: Add "approved" label when approved + runs-on: ubuntu-latest + steps: + - name: Add "approved" label when approved + uses: pullreminders/label-when-approved-action@master + env: + APPROVALS: "1" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ADD_LABEL: "approved" + REMOVE_LABEL: "" \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..1711d73 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,64 @@ +name: "Code Scanning - Action" + +on: + push: + branches: [main] + paths: + - "C++/**" + - ".github/workflows/codeql.yml" + pull_request: + branches: [main] + 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@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + # 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@v2 + + # ℹ️ 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@v2 \ No newline at end of file From 36997f9d9be6222af646277fca74f1d967e4601e Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:04:32 +0530 Subject: [PATCH 3/9] updated changes --- .github/CODEOWNERS | 2 +- .github/workflows/approved-label.yml | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 643c4fc..42ff282 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @dev-madhurendra \ No newline at end of file +* @dev-madhurendra @Suryac72 \ No newline at end of file diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index ce48ded..de0331f 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -1,14 +1,22 @@ -on: pull_request_review name: Add "approved" label when approved + +on: + pull_request_review: + types: + - submitted + jobs: add_label: name: Add "approved" label when approved runs-on: ubuntu-latest steps: - - name: Add "approved" label when approved - uses: pullreminders/label-when-approved-action@master - env: - APPROVALS: "1" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ADD_LABEL: "approved" - REMOVE_LABEL: "" \ No newline at end of file + - name: Check for approval + id: check_approval + run: echo "::set-output name=approved::${{ github.event.review.state == 'approved' }}" + + - name: Add "approved" label + if: steps.check_approval.outputs.approved == 'true' + run: | + echo "Adding 'approved' label" + echo "approved" >> labels.txt + gh pr edit ${{ github.event.pull_request.number }} --add-labels labels.txt From e7252185efb26605ee6fe565b6d15ca2321f7299 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:10:59 +0530 Subject: [PATCH 4/9] fixed approved label buil failing --- .github/workflows/approved-label.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index de0331f..3cebc98 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -18,5 +18,4 @@ jobs: if: steps.check_approval.outputs.approved == 'true' run: | echo "Adding 'approved' label" - echo "approved" >> labels.txt - gh pr edit ${{ github.event.pull_request.number }} --add-labels labels.txt + gh pr edit ${{ github.event.pull_request.number }} --add-label approved From a68cee16308806d54618fb2380daabbedbd16bb6 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:15:20 +0530 Subject: [PATCH 5/9] fixed approved label build --- .github/workflows/approved-label.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 3cebc98..306e73a 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -16,6 +16,8 @@ jobs: - name: Add "approved" label if: steps.check_approval.outputs.approved == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Adding 'approved' label" gh pr edit ${{ github.event.pull_request.number }} --add-label approved From 5bd6ee7dc6495d279f540ae94ac8093dc15fc995 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:19:29 +0530 Subject: [PATCH 6/9] updated approved-label build file --- .github/workflows/approved-label.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 306e73a..d829b3b 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -10,6 +10,9 @@ jobs: name: Add "approved" label when approved runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v2 # Make sure to use the latest version + - name: Check for approval id: check_approval run: echo "::set-output name=approved::${{ github.event.review.state == 'approved' }}" @@ -20,4 +23,5 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Adding 'approved' label" + cd $GITHUB_WORKSPACE # Set the working directory to the root of the repository gh pr edit ${{ github.event.pull_request.number }} --add-label approved From d1be90bc49161ccd1f87c6288ed781fd2fdf7aa4 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:24:40 +0530 Subject: [PATCH 7/9] updated approved-label build file --- .github/workflows/approved-label.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index d829b3b..583daf7 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -23,5 +23,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Adding 'approved' label" - cd $GITHUB_WORKSPACE # Set the working directory to the root of the repository gh pr edit ${{ github.event.pull_request.number }} --add-label approved From 05b5d30f9218b1b68802b4a2d74997a6d4922446 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:28:45 +0530 Subject: [PATCH 8/9] updated approved-label build file --- .github/workflows/approved-label.yml | 28 +++++++--------------- .github/workflows/gh-pages.yml | 36 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 583daf7..556419d 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -1,26 +1,14 @@ +on: pull_request_review name: Add "approved" label when approved - -on: - pull_request_review: - types: - - submitted - jobs: add_label: name: Add "approved" label when approved runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 # Make sure to use the latest version - - - name: Check for approval - id: check_approval - run: echo "::set-output name=approved::${{ github.event.review.state == 'approved' }}" - - - name: Add "approved" label - if: steps.check_approval.outputs.approved == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "Adding 'approved' label" - gh pr edit ${{ github.event.pull_request.number }} --add-label approved + - name: Add "approved" label when approved + uses: pullreminders/label-when-approved-action@main + env: + APPROVALS: "1" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ADD_LABEL: "approved" + REMOVE_LABEL: "" \ No newline at end of file diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..065fe13 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,36 @@ +name: Doxygen CI + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install requirements + run: | + brew install graphviz ninja doxygen + - name: configure + run: cmake -G Ninja -B ./build -S . + - name: build + run: cmake --build build -t doc + - name: gh-pages + uses: actions/checkout@v3 + with: + ref: "gh-pages" + clean: false + - name: Move & Commit files + run: | + git config --global user.name github-actions + 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 && rm *.css + 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 \ No newline at end of file From 73e547c58986efe450d1311ac15f8c86ccd3cd83 Mon Sep 17 00:00:00 2001 From: madhuredra Date: Sat, 23 Sep 2023 23:37:38 +0530 Subject: [PATCH 9/9] added latest version of it --- .github/workflows/approved-label.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 556419d..77e2247 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -1,14 +1,14 @@ on: pull_request_review -name: Add "approved" label when approved +name: Label approved pull requests jobs: - add_label: - name: Add "approved" label when approved + labelWhenApproved: + name: Label when approved runs-on: ubuntu-latest steps: - - name: Add "approved" label when approved - uses: pullreminders/label-when-approved-action@main + - name: Label when approved + uses: abinoda/label-when-approved-action@1.0.5 env: - APPROVALS: "1" + APPROVALS: "2" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ADD_LABEL: "approved" - REMOVE_LABEL: "" \ No newline at end of file + REMOVE_LABEL: "awaiting%20review" \ No newline at end of file