diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 921d0f6..611b5dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,29 +1,31 @@ name: "Build" on: - issue_comment: - types: [created] + pull_request: + branches: [ main ] + #issue_comment: + # types: [created] jobs: - trigger-comment: - if: github.event.issue.pull_request && contains(github.event.comment.body, '/build') - runs-on: ubuntu-latest - steps: - - name: "Post trigger comment" - uses: actions/github-script@v7 - with: - script: | - const workflowUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`; - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `🚀 Build workflow triggered! [View run](${workflowUrl})` - }); + #trigger-comment: + # if: github.event.issue.pull_request && contains(github.event.comment.body, '/build') + # runs-on: ubuntu-latest + # steps: + # - name: "Post trigger comment" + # uses: actions/github-script@v7 + # with: + # script: | + # const workflowUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`; + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: `🚀 Build workflow triggered! [View run](${workflowUrl})` + # }); build: - needs: trigger-comment - if: github.event.issue.pull_request && contains(github.event.comment.body, '/build') + #needs: trigger-comment + #if: github.event.issue.pull_request && contains(github.event.comment.body, '/build') strategy: matrix: include: @@ -36,8 +38,8 @@ jobs: name: ${{ matrix.name }} runs-on: ubuntu-latest - container: - image: ${{ matrix.image }} + #container: + # image: ${{ matrix.image }} steps: - name: "Free disk space" @@ -45,56 +47,60 @@ jobs: sudo rm -rf /usr/local/lib/android || true sudo rm -rf /usr/share/dotnet || true - - name: "Retrieve PR info" - uses: actions/github-script@v7 - id: pr-info - with: - script: | - const pr = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - core.setOutput('sha', pr.data.head.sha); + #- name: "Retrieve PR info" + # uses: actions/github-script@v7 + # id: pr-info + # with: + # script: | + # const pr = await github.rest.pulls.get({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # pull_number: context.issue.number + # }); + # core.setOutput('sha', pr.data.head.sha); - name: "Checkout PR code" uses: actions/checkout@v4 - with: - ref: ${{ steps.pr-info.outputs.sha }} + #with: + # ref: ${{ steps.pr-info.outputs.sha }} - name: "Full build with NVSHMEM" run: | - mkdir -p build-nvshmem - cd build-nvshmem - cmake -DCUDECOMP_ENABLE_NVSHMEM=1 -DCUDECOMP_BUILD_EXTRAS=1 .. - make -j$(nproc) + docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.image }} bash -c ' + mkdir -p build-nvshmem + cd build-nvshmem + cmake -DCUDECOMP_ENABLE_NVSHMEM=1 -DCUDECOMP_BUILD_EXTRAS=1 .. + make -j$(nproc) + ' - name: "Library only build without NVSHMEM" run: | - mkdir -p build-no-nvshmem - cd build-no-nvshmem - cmake .. - make -j$(nproc) + docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.image }} bash -c ' + mkdir -p build-no-nvshmem + cd build-no-nvshmem + cmake .. + make -j$(nproc) + ' - result-comment: - needs: build - if: always() && github.event.issue.pull_request && contains(github.event.comment.body, '/build') - runs-on: ubuntu-latest - steps: - - name: "Post result comment" - uses: actions/github-script@v7 - with: - script: | - const workflowUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`; - const success = '${{ needs.build.result }}' === 'success'; + #result-comment: + # needs: build + # if: always() && github.event.issue.pull_request && contains(github.event.comment.body, '/build') + # runs-on: ubuntu-latest + # steps: + # - name: "Post result comment" + # uses: actions/github-script@v7 + # with: + # script: | + # const workflowUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`; + # const success = '${{ needs.build.result }}' === 'success'; - const message = success - ? `✅ Build workflow passed! [View run](${workflowUrl})` - : `❌ Build workflow failed! [View run](${workflowUrl})`; + # const message = success + # ? `✅ Build workflow passed! [View run](${workflowUrl})` + # : `❌ Build workflow failed! [View run](${workflowUrl})`; - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: message - }); + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: message + # });