This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
Bump gitpython from 3.0.3 to 3.1.32 (#5068) #7277
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- uses: pre-commit/[email protected] | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9.x | |
architecture: x64 | |
- name: Fetch ParlAI | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Fix git | |
run: | | |
set -eux | |
git fetch origin main | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
git branch -f main origin/main | |
fi | |
- name: Run flake8 | |
run: | | |
set -eux | |
pip install -q flake8 flake8-bugbear flake8-black docformatter==1.3.0 black==22.3.0 | |
python setup.py develop --no-deps # get our custom flake8 errors | |
python -c 'import parlai' | |
flake8 --version | |
bash autoformat.sh -c -f | tee ${GITHUB_WORKSPACE}/output-annotations.txt | |
- name: Add annotations | |
uses: pytorch/add-annotations-github-action@master | |
with: | |
check_name: 'lint' | |
linter_output_path: 'output-annotations.txt' | |
commit_sha: ${{ github.event.pull_request.head.sha }} | |
regex: '^(?<filename>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+): (?<errorCode>\w+\d+) (?<errorDesc>.*)' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Failure check | |
run: | | |
if [ "$(cat ${GITHUB_WORKSPACE}/output-annotations.txt | wc -l)" != "0" ] | |
then | |
exit 1 | |
fi | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9.x | |
architecture: x64 | |
- name: Fetch ParlAI | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Fix git | |
run: | | |
set -eux | |
git fetch origin main | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
git branch -f main origin/main | |
fi | |
- name: Get head SHA | |
run: | | |
HEAD_SHA="NONE" | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
else | |
HEAD_SHA="${{ github.event.push.head.sha }}" | |
fi | |
echo $HEAD_SHA | |
echo "HEAD_SHA=${HEAD_SHA}" >> $GITHUB_ENV | |
- name: caching dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: pip-20200712--${{ hashFiles('**/requirements.txt') }} | |
id: cache | |
- name: install dependencies | |
run: | | |
pip install -q -r requirements.txt | |
pip install -q mypy mypy-extensions | |
pip install -q git+https://github.com/numpy/numpy-stubs.git | |
pip install -q torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | |
- name: mypy | |
run: | | |
set -eux | |
mypy | sort | grep -v '^Found ' > typeerrors-HEAD.txt | |
forkpoint=$(git merge-base main HEAD) | |
git checkout -f $forkpoint | |
mypy | sort | grep -v '^Found ' > typeerrors-main.txt | |
diff -u typeerrors-main.txt typeerrors-HEAD.txt | grep -v '^+++' | grep '^+' > typeerrors-CHANGED.txt || true | |
cat typeerrors-CHANGED.txt | sed 's/^+//' | sed 's/: error:/:1: mypy:/' | tee ${GITHUB_WORKSPACE}/output-annotations.txt | |
- name: Add annotations | |
uses: stephenroller/add-annotations-github-action@master | |
with: | |
check_name: 'mypy' | |
linter_output_path: 'output-annotations.txt' | |
commit_sha: ${{ env.HEAD_SHA }} | |
regex: '^(?<filename>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+): (?<errorCode>\w+): (?<errorDesc>.*)' | |
annotation_level: warning | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jslint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch ParlAI | |
uses: actions/checkout@v1 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Get head SHA | |
run: | | |
HEAD_SHA="NONE" | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
else | |
HEAD_SHA="${{ github.event.push.head.sha }}" | |
fi | |
echo $HEAD_SHA | |
echo "HEAD_SHA=${HEAD_SHA}" >> $GITHUB_ENV | |
- name: Setup | |
working-directory: parlai/crowdsourcing/ | |
run: | | |
set -eux | |
npm install | |
npm install --save-dev -g eslint | |
- name: Run ESLint | |
working-directory: parlai/crowdsourcing/ | |
run: | | |
set -eux | |
npx eslint --format unix . | \ | |
sed "s#${GITHUB_WORKSPACE}#.#" | \ | |
tee ${GITHUB_WORKSPACE}/output-annotations.txt | |
- name: Add annotations | |
uses: pytorch/add-annotations-github-action@master | |
with: | |
check_name: 'jslint' | |
linter_output_path: 'output-annotations.txt' | |
commit_sha: ${{ env.HEAD_SHA }} | |
regex: '^(?<filename>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+): (?<errorDesc>.*) \[(?<errorCode>.*)\]' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |