diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 991be798aa..3ed939bbc5 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -1,6 +1,10 @@ on: push: pull_request: + merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true name: Build C++ jobs: buildcc: diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 3795a5ccce..cd89a8bb39 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -3,6 +3,11 @@ name: Build and upload to PyPI on: push: pull_request: + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true jobs: determine-arm64-runner: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c5460109f4..094ca06df5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -5,7 +5,9 @@ on: pull_request: schedule: - cron: '45 2 * * 2' - +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true jobs: analyze: name: Analyze diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 877c780f1f..be43c5cff2 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -11,4 +11,4 @@ jobs: steps: - uses: actions/labeler@v5 with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/package_c.yml b/.github/workflows/package_c.yml index 5594c79181..f45b5f4aef 100644 --- a/.github/workflows/package_c.yml +++ b/.github/workflows/package_c.yml @@ -3,7 +3,10 @@ name: Build C library on: push: pull_request: - + merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true jobs: build_c: name: Build C library diff --git a/.github/workflows/test_cc.yml b/.github/workflows/test_cc.yml index f2af6f45ae..37f5cc2ef6 100644 --- a/.github/workflows/test_cc.yml +++ b/.github/workflows/test_cc.yml @@ -1,6 +1,10 @@ on: push: pull_request: + merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true name: Test C++ jobs: testcc: diff --git a/.github/workflows/test_cuda.yml b/.github/workflows/test_cuda.yml index 7c08e50912..06af746ad4 100644 --- a/.github/workflows/test_cuda.yml +++ b/.github/workflows/test_cuda.yml @@ -4,6 +4,12 @@ on: pull_request: types: - "labeled" + # to let the PR pass the test + - "synchronize" + merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true name: Test CUDA jobs: test_cuda: @@ -13,7 +19,7 @@ jobs: container: image: nvidia/cuda:12.2.0-devel-ubuntu22.04 options: --gpus all - if: github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch' + if: github.repository_owner == 'deepmodeling' && (github.event_name == 'pull_request' && github.event.label && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group') steps: - name: Make sudo and git work run: apt-get update && apt-get install -y sudo git @@ -69,3 +75,13 @@ jobs: - uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + pass: + name: Pass testing on CUDA + needs: [test_cuda] + runs-on: ubuntu-latest + if: always() + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index e1ac3a716c..0e51a7e2c3 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -1,6 +1,10 @@ on: push: pull_request: + merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true name: Test Python jobs: testpython: @@ -27,8 +31,6 @@ jobs: mpi: openmpi # https://github.com/pypa/pip/issues/11770 - run: python -m pip install -U "pip>=21.3.1,!=23.0.0" - - run: python -m pip install -U "torch==${{ matrix.torch }}" "numpy<1.20" - if: matrix.torch != '' - run: pip install -e .[cpu,test,torch] env: TENSORFLOW_VERSION: ${{ matrix.tf }}