Skip to content

Commit

Permalink
added build for programming languages
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuredra committed Sep 23, 2023
1 parent 73e547c commit 4445701
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 74 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/approved-label.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
on: pull_request_review
name: Label approved pull requests
name: Add "approved" label when approved

on:
pull_request_review:
types:
- submitted

jobs:
labelWhenApproved:
name: Label when approved
add_label:
name: Add "approved" label when approved
runs-on: ubuntu-latest

steps:
- name: Label when approved
uses: abinoda/label-when-approved-action@1.0.5
env:
APPROVALS: "2"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ADD_LABEL: "approved"
REMOVE_LABEL: "awaiting%20review"
- 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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Adding 'approved' label"
gh pr edit ${{ github.event.pull_request.number }} --add-label approved
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- "C++/**"
- ".github/workflows/codeql.yml"
pull_request:
paths:
- "C++/**"
- ".github/workflows/codeql.yml"

branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/gh-pages.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/goBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# https://github.com/golangci/golangci-lint
name: Continuous Integration
on:
push:
# prevent duplication of tests with
# `pull_request` event
branches:
- main
paths:
- "Golang/**"
- ".github/workflows/goBuild.yml"

pull_request:

jobs:
golang_lint_and_test:
name: Code style and tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.18'
- name: Run Golang CI Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: -E gofmt
- name: Run tests
run: go test ./...
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@master
with:
ignore_words_list: "actualy,nwe"
skip: "go.mod,go.sum"
24 changes: 24 additions & 0 deletions .github/workflows/javaBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Clang format linter

on:
push:
paths:
- 'Java/**' # This restricts the workflow to changes in the 'Java' folder
- '.github/workflows/javaBuild.yml'
pull_request:
paths:
- 'Java/**' # This restricts the workflow to changes in the 'Java' folder
- '.github/workflows/javaBuild.yml'


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: './src'
extensions: 'java'
clangFormatVersion: 16
56 changes: 42 additions & 14 deletions .github/workflows/jsBuild.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
name: Build
name: Continuous Integration

on:
push:
branches:
- main
paths:
- "JavaScript/**"
- ".github/workflows/jsBuild.yml"
- 'JavaScript/**' # Include the JavaScript folder and its subdirectories
- 'TypeScript/**' # Include the TypeScript folder and its subdirectories
- '.github/workflows/jsBuild.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'JavaScript/**' # Include the JavaScript folder and its subdirectories
- 'TypeScript/**' # Include the TypeScript folder and its subdirectories
- '.github/workflows/jsBuild.yml'


jobs:
sonarcloud:
name: SonarCloud
build:
name: Code style and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm

- name: 📦 Install dependencies
run: npm ci

- name: 🧪 Run all tests
if: ${{ github.event_name == 'push' }}
run: npm run test

- name: 🧪 Run tests for changed files only
if: ${{ github.event_name == 'pull_request' }}
run: npm run test-changed

- name: 💄 Code style
run: npm run style

codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@master
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 }}
# file types to ignore
skip: "*.json,*.yml,DIRECTORY.md"
ignore_words_list: "ba,esy,yse,falsy"
13 changes: 0 additions & 13 deletions sonar-project.properties

This file was deleted.

0 comments on commit 4445701

Please sign in to comment.