Skip to content

Commit

Permalink
add on pr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadit19 committed Oct 26, 2024
1 parent c23053d commit efdbee3
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Pull Request check"

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clone submodules
run: |
git submodule init
git submodule update
- name: Update and Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential g++
- name: Build
id: build
run: |
mkdir build
cd build
cmake ..
make
- name: Post success comment
if: ${{ success() }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Build successful! 🎉'
});
- name: Post failure comment
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
...context.repo,
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Build failed! ❌\n\n\`\`\`\n${{ steps.build.outputs.stderr || 'Unknown error' }}\n\`\`\``
});

0 comments on commit efdbee3

Please sign in to comment.