From 725a39f4bdab7a09d3d7a14a38dfb575d5e9b64c Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Thu, 17 Mar 2022 10:38:04 +0800 Subject: [PATCH] update github CI with the current workflow (#441) --- .github/workflows/assign_reviewer.yml | 3 +-- .github/workflows/build.yml | 7 ++----- .github/workflows/compatibility_test.yml | 2 +- .github/workflows/release.yml | 12 ++---------- .github/workflows/release_test.yml | 24 ++++++++++++++++++++++++ .github/workflows/submodule.yml | 2 +- 6 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/release_test.yml diff --git a/.github/workflows/assign_reviewer.yml b/.github/workflows/assign_reviewer.yml index 871768938..6ebb33982 100644 --- a/.github/workflows/assign_reviewer.yml +++ b/.github/workflows/assign_reviewer.yml @@ -9,8 +9,7 @@ jobs: name: Assign Reviewer for PR runs-on: ubuntu-latest if: | - github.event.pull_request.draft == false && - (github.base_ref == 'main' || github.base_ref == 'develop') + github.event.pull_request.draft == false && github.base_ref == 'main' && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && toJson(github.event.pull_request.requested_reviewers) == '[]' steps: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de4da9057..47fc7e471 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,8 @@ jobs: build: name: Build and Test Colossal-AI if: | - github.event.pull_request.draft == false && - (github.base_ref == 'main' || github.base_ref == 'develop') && + github.event.pull_request.draft == false && + github.base_ref == 'main' && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && contains( github.event.pull_request.labels.*.name, 'Run Build and Test') runs-on: [self-hosted, gpu] @@ -18,9 +18,6 @@ jobs: options: --gpus all --rm --ipc=host -v /data/scratch/cifar-10:/data/scratch/cifar-10 timeout-minutes: 40 steps: - - name: Setup Environment - run: | - export https_proxy=http://172.17.0.1:7890 http_proxy=http://172.17.0.1:7890 all_proxy=socks5://172.17.0.1:7890 - name: Install dependencies run: | pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple diff --git a/.github/workflows/compatibility_test.yml b/.github/workflows/compatibility_test.yml index 6b6a4304b..73dad1d90 100644 --- a/.github/workflows/compatibility_test.yml +++ b/.github/workflows/compatibility_test.yml @@ -5,7 +5,7 @@ on: workflow_dispatch jobs: build: name: Test for PyTorch compatibility - if: (github.base_ref == 'main' || github.base_ref == 'develop') && github.repository == 'hpcaitech/ColossalAI' + if: github.base_ref == 'main' && github.repository == 'hpcaitech/ColossalAI' runs-on: [self-hosted, aws] strategy: fail-fast: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c274bfa73..a50839b01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,8 @@ on: workflow_dispatch jobs: build-n-publish: - if: (github.base_ref == 'main' || github.base_ref == 'develop') && github.repository == 'hpcaitech/ColossalAI' && contains('["FrankLeeeee", "ver217", "feifeibear", "kurisusnowdeng"]', github.actor) - name: Build and publish Python 🐍 distributions 📦 to PyPI or Test PyPI + if: github.base_ref == 'main' && github.repository == 'hpcaitech/ColossalAI' && contains('["FrankLeeeee", "ver217", "feifeibear", "kurisusnowdeng"]', github.actor) + name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-latest timeout-minutes: 20 steps: @@ -15,15 +15,7 @@ jobs: python-version: '3.7.4' # publish to PyPI if executed on the main branch # publish to Test PyPI if executed on the develop branch - - name: Publish package to Test PyPI - if: github.base_ref == 'develop' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - verbose: true - name: Publish package to PyPI - if: github.base_ref == 'main' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml new file mode 100644 index 000000000..b28e34fb2 --- /dev/null +++ b/.github/workflows/release_test.yml @@ -0,0 +1,24 @@ +name: Publish to Test PyPI + +on: workflow_dispatch + +jobs: + build-n-publish: + if: github.base_ref == 'main' && github.repository == 'hpcaitech/ColossalAI' && contains('["FrankLeeeee", "ver217", "feifeibear", "kurisusnowdeng"]', github.actor) + name: Build and publish Python 🐍 distributions 📦 to Test PyPI + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.7.4' + # publish to PyPI if executed on the main branch + # publish to Test PyPI if executed on the develop branch + - name: Publish package to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + verbose: true diff --git a/.github/workflows/submodule.yml b/.github/workflows/submodule.yml index 2447284e8..ac01f85db 100644 --- a/.github/workflows/submodule.yml +++ b/.github/workflows/submodule.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: 'develop' + ref: 'main' submodules: true - name: echo