diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 198c90772..507ff73d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,11 @@ on: types: - created - edited + workflow_dispatch: + inputs: + pullRequest: + description: 'Pull Request ID' + required: true env: vulkanSdkVersion: '1.3.283.0' @@ -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 @@ -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: | @@ -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 @@ -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" @@ -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