Skip to content

fix ci

fix ci #2990

Workflow file for this run

name: pr_stage_test
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
on:
pull_request:
paths-ignore:
- ".github/**.md"
- "docker/**"
- "docs/**"
- "README.md"
- "README_zh-CN.md"
- "CONTRIBUTING.md"
- "CONTRIBUTING_zh-CN.md"
- ".pre-commit-config.yaml"
- ".pre-commit-config-zh-cn.yaml"
- "examples/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_cpu:
runs-on: ubuntu-22.04
env:
CONTAINER: python:3.9
strategy:
matrix:
python-version: [3.9]
torch: [2.0.0]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Start Docker Container
run: |
docker pull $CONTAINER
docker run --name build-container -d -e MKL_THREADING_LAYER=GNU -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null
- name: Install Dependencies
env:
SCRIPT: |
pip install pip wheel --upgrade
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
pip install torch==${{matrix.torch}}+cpu
pip install -e . -v
pip install -r requirements/tests.txt
pip install openmim
pip install torch==${{matrix.torch}}
mim install mmcv coverage pytest parameterized
run: docker exec build-container bash -c "$SCRIPT"
- name: Build
env:
SCRIPT: |
cd /workspace
coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
coverage xml
coverage report -m
run: docker exec build-container bash -c "$SCRIPT"
build_gpu:
runs-on: ubuntu-22.04
env:
CONTAINER: continuumio/miniconda3
strategy:
matrix:
python-version: [3.10.16, 3.9]
torch: [2.0.0, 2.3.1]
steps:
- uses: actions/checkout@v4
- name: Start Docker Container
run: |
docker pull $CONTAINER
docker run --name build-container -d -e MKL_THREADING_LAYER=GNU -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null
- name: Install Dependencies
env:
SCRIPT: |
conda create -n test python=${{ matrix.python-version }} -y
conda init && source activate base && conda activate test
pip install pip wheel --upgrade
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
pip install torch==${{matrix.torch}}
pip install -e . -v
pip install -r requirements/tests.txt
pip install openmim
pip install torch==${{matrix.torch}}
mim install mmcv coverage pytest parameterized numpy==1.21.2
run: docker exec build-container bash -c "$SCRIPT"
- name: Build
env:
SCRIPT: |
cd /workspace
conda init && source activate base && conda activate test
coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
coverage xml
coverage report -m
run: docker exec build-container bash -c "$SCRIPT"
# build_windows:
# runs-on: windows-2022
# strategy:
# matrix:
# python-version: [3.9]
# platform: [cpu, cu111]
# torch: [1.8.1]
# torchvision: [0.9.1]
# include:
# - python-version: 3.8
# platform: cu118
# torch: 2.1.0
# torchvision: 0.16.0
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Upgrade pip
# # Windows CI could fail If we call `pip install pip --upgrade` directly.
# run: python -m pip install pip wheel --upgrade
# - name: Install PyTorch
# run: pip install torch==${{matrix.torch}}+${{matrix.platform}} torchvision==${{matrix.torchvision}}+${{matrix.platform}} -f https://download.pytorch.org/whl/${{matrix.platform}}/torch_stable.html
# - name: Build MMEngine from source
# run: pip install -e . -v
# - name: Install unit tests dependencies
# run: |
# pip install -r requirements/tests.txt
# pip install openmim
# mim install mmcv
# - name: Run CPU unittests
# run: pytest tests/ --ignore tests/test_dist
# if: ${{ matrix.platform == 'cpu' }}
# - name: Run GPU unittests
# # Skip testing distributed related unit tests since the memory of windows CI is limited
# run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py
# if: ${{ matrix.platform == 'cu111' }} || ${{ matrix.platform == 'cu118' }}