Move CI from CircleCI to Github Actions #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint checks release version of PyTorch on Linux CPU | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
lint: | |
strategy: | |
matrix: | |
python_version: ["3.9"] | |
fail-fast: false | |
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | |
with: | |
runner: linux.2xlarge | |
repository: pytorch/opacus | |
timeout: 60 | |
script: | | |
echo '::group::Create conda env with correct Python version' | |
set -x | |
PYTHON_VERSION="${{ matrix.python_version }}" | |
conda create --yes --quiet -n test python="${PYTHON_VERSION}" | |
conda activate test | |
python --version | grep "${PYTHON_VERSION}" | |
echo '::endgroup::' | |
echo '::group::Install dependencies via pip, including extra deps.' | |
./scripts/install_via_pip.sh | |
echo '::endgroup::' | |
echo '::group::Lint with flake8' | |
flake8 --config ./.github/flake8_config.ini | |
echo '::endgroup::' | |
echo '::group::Lint with black' | |
black --check --diff --color . | |
echo '::endgroup::' | |
echo '::group::Check import order with isort' | |
isort -v -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma --check-only . | |
echo '::endgroup::' |