forked from Instagram/LibCST
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Actions and derive version from git tags (Instagram#471)
* Use setuptools-scm to derive the current version from git metadata * Add Github Action equivalent to the current circleci tasks * Run pyre integration test in GH action / tox
- Loading branch information
Showing
9 changed files
with
138 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"source_directories": [ | ||
"." | ||
], | ||
"search_path": [ | ||
"stubs", "~/cache/tox/pyre/lib/python3.8/site-packages/" | ||
], | ||
"strict": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Python CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PIP_CACHE_DIR: ~/cache/pip | ||
|
||
jobs: | ||
tox: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: [3.6, 3.7, 3.8] | ||
environment: [test] | ||
include: | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
environment: lint | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
environment: docs | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
environment: coverage | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
environment: pyre | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: pip cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: '~/cache' | ||
key: pip-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.environment }}-${{ hashFiles('tox.ini', 'requirements.txt', 'requirements-dev.txt', 'setup.py') }} | ||
restore-keys: | | ||
pip-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.environment }}- | ||
pip-${{ matrix.os }}-${{ matrix.python-version }}- | ||
pip-${{ matrix.os }}- | ||
- name: install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions -r requirements.txt -r requirements-dev.txt | ||
- name: run tox | ||
run: tox --workdir ~/cache/tox -e ${{ matrix.environment }} | ||
- name: Archive Docs | ||
if: matrix.environment == 'docs' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: sphinx-docs | ||
path: docs/build | ||
- name: Archive Coverage | ||
if: matrix.environment == 'coverage' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage | ||
path: coverage.xml | ||
|
||
# Build python package | ||
build: | ||
needs: tox | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ |
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ pyre-check==0.0.41 | |
sphinx-rtd-theme>=0.4.3 | ||
prompt-toolkit>=2.0.9 | ||
tox>=3.18.1 | ||
setuptools_scm>=6.0.1 |
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
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