Test Suite on GitHub Actions (#907)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* Test Suite on GitHub Actions * Add linting checks * Update badges. Drop unused codecov, pending GitHub action support,
authored by Tom Christie · committed by GitHub · parent 9085582 · Browse files · 7 files·+47 added−78 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+47 added−78 removed
- other:+47 added−78 removed
Provenance
- Commit
19bf211- Tree
bb33789- Author
Tom Christie <tom@tomchristie.com>- Committer
GitHub <noreply@github.com>- Parent
9085582
7 files changed+47 added−78 removed
added:.github/workflows/test-suite.yml+29 added
1234567891011121314151617181920212223242526272829---name: Test Suite
on: push: branches: ["master"] pull_request: branches: ["master"]
jobs: tests: name: "Python ${{ matrix.python-version }}" runs-on: "ubuntu-latest"
strategy: matrix: python-version: ["3.6", "3.7", "3.8"]
steps: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v1" with: python-version: "${{ matrix.python-version }}" - name: "Install dependencies" run: "scripts/install" - name: "Run linting checks" run: "scripts/check" - name: "Run tests" run: "scripts/test"modified:docs/index.md+2 added-5 removed
8 unmodified lines9101112131413141516171816171819114 unmodified linesExpand all8 unmodified lines---
<div align="center"><p><a href="https://travis-ci.org/encode/httpx"> <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status"><a href="https://github.com/encode/httpx/actions"> <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite"></a><a href="https://codecov.io/gh/encode/httpx"> <img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage"></a><a href="https://pypi.org/project/httpx/"> <img src="https://badge.fury.io/py/httpx.svg" alt="Package version"></a></p>114 unmodified linesExpand allmodified:scripts/install+13 added-9 removed
1 #!/bin/sh -e2 3-export PREFIX="venv/bin/"3+# Use the Python executable provided from the `-p` option, or a default.4+[ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3"5 6+REQUIREMENTS="requirements.txt"7+VENV="venv"8+9 set -x10 7-python -m venv venv8-${PREFIX}python -m pip install -U pip9-${PREFIX}python -m pip install -r requirements.txt11+if [ -z "$GITHUB_ACTIONS" ]; then12+ "$PYTHON" -m venv "$VENV"13+ PIP="$VENV/bin/pip"14+else15+ PIP="pip"16+fi17 11-set +x12-13-echo14-echo "Success! You can now activate your virtual environment using:"15-echo "source ${PREFIX}activate"18+"$PIP" install -r "$REQUIREMENTS"19+"$PIP" install -e .modified:scripts/test+1 added-1 removed
5 unmodified lines6 fi7 8 set -x9 10-if [ -z $CI ]; then10+if [ -z $GITHUB_ACTIONS ]; then11 scripts/check12 fi13 14 ${PREFIX}pytest $@deleted:.travis.yml-53 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253dist: xeniallanguage: python
cache: pip
branches: only: - master
python: - 3.6 - 3.7 - 3.8
stages: - check - docs - test
matrix: include: - stage: check python: 3.7 script: scripts/check - stage: docs python: 3.7 script: scripts/docs-build - stage: test os: windows language: shell python: 3.7 env: PATH=/c/Python37:/c/Python37/Scripts:$PATH before_install: - choco install python --version 3.7 - python -m pip install --upgrade pip install: pip install -r requirements.txt script: scripts/test
fast_finish: true allow_failures: # FIX # Some tests not yet resolved for Windows. (In progress) - os: windows
script: scripts/test
after_script: - if [ -f .coverage ]; then python -m pip install codecov; codecov --required; fideleted:codecov.yml-8 removed
12345678coverage: status: patch: default: target: '100' project: default: target: '100'modified:README.md+2 added-2 removed
3 unmodified lines4 5 <p align="center"><strong>HTTPX</strong> <em>- A next-generation HTTP client for Python.</em></p>6 7 <p align="center">8-<a href="https://travis-ci.org/encode/httpx">9- <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">8+<a href="https://github.com/encode/httpx/actions">9+ <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite">10 </a>11 <a href="https://codecov.io/gh/encode/httpx">12 <img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage">13 </a>117 unmodified lines