Skip to content

Commit

Permalink
Allow to manually trigger CI builds without comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
crud89 authored Aug 26, 2024
1 parent 1fbd254 commit 5645428
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
types:
- created
- edited
workflow_dispatch:
inputs:
pullRequest:
description: 'Pull Request ID'
required: true

env:
vulkanSdkVersion: '1.3.283.0'
Expand All @@ -18,7 +23,7 @@ jobs:
permissions:
issues: write
pull-requests: write
if: "${{ ( github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, 'Run: Tests') ) }}"
if: "${{ (github.event_name == 'workflow_dispatch') || ( github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, 'Run: Tests') ) }}"

steps:
- name: Check persmission
Expand Down Expand Up @@ -54,16 +59,20 @@ jobs:
include:
- os: windows-latest
triplet: x64-windows
compiler: msvc
configuration: windows-msvc-x64-test
architecture: x64
- os: windows-latest
triplet: x64-windows
compiler: clang
configuration: windows-clang-x64-test
architecture: x64

steps:
- name: Retrieve PR info
id: retrieve-pr-from-issue-comment
uses: actions/github-script@v3
if: ${{ github.event_name == 'issue_comment' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -76,6 +85,23 @@ jobs:
console.log('HEAD SHA = ' + pull_request.data.head.sha + ', REF = ' + pull_request.data.head.ref)
core.exportVariable('HEAD_SHA', pull_request.data.head.sha)
core.exportVariable('HEAD_REF', pull_request.data.head.ref)
- name: Retrieve PR info
id: retrieve-pr-from-workflow-dispatch
uses: actions/github-script@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log('Retrieving HEAD REF for PR #${{ github.event.inputs.pullRequest }}')
const pull_request = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: ${{ github.event.issue.number }}
})
console.log('HEAD SHA = ' + pull_request.data.head.sha + ', REF = ' + pull_request.data.head.ref)
core.exportVariable('HEAD_SHA', pull_request.data.head.sha)
core.exportVariable('HEAD_REF', pull_request.data.head.ref)
- name: Create checks
uses: LouisBrunner/checks-action@v2.0.0
Expand Down Expand Up @@ -108,6 +134,7 @@ jobs:
echo "C:\Program Files\OpenCppCoverage" >> $GITHUB_PATH
- name: Install LLVM and Clang
if: ${{ matrix.compiler == 'clang' }}
uses: KyleMayes/install-llvm-action@v2
with:
version: "18.0"
Expand Down Expand Up @@ -153,7 +180,7 @@ jobs:
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/src/Modules/vcpkg'
vcpkgJsonGlob: '**/vcpkg.json'
vcpkgJsonGlob: '${{ github.workspace }}/src/vcpkg.json'

- name: Build Runtime and Tests
id: build-with-cmake
Expand Down

0 comments on commit 5645428

Please sign in to comment.