-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.4 KB
/
test-with-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: build
on:
push:
jobs:
test:
name: Run Tests and Code Coverage 📝
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies ⚙️
run: |
python -m pip install --upgrade pip
pip install .
pip install build pytest pytest-cov
- name: Download pandoc
run: |
curl --silent "https://api.github.com/repos/jgm/pandoc/releases/latest" | jq -r ".. .tag_name? // empty" | awk '{print "pandoc_url=https://github.com/jgm/pandoc/releases/download/"$1"/pandoc-"$1"-1-amd64.deb"}' >> $GITHUB_ENV
- name: Install pandoc 📄
run: |
wget --output-document pandoc.deb "${{ env.pandoc_url }}"
sudo dpkg -i pandoc.deb
- name: Test with pytest ✅
run: |
pytest --cov=plaited
- name: Coveralls 👖
if: matrix.python-version == '3.10'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: $COVERALLS_REPO_TOKEN
run: |
pip install coveralls
coveralls
- name: Try building a binary wheel and a source tarball 🚧
run: |
python -m build --sdist --wheel --outdir dist/ .