Skip to content

Commit 495fdd5

Browse files
ishevchejoaopfonseca
authored andcommitted
Added ci workflow
1 parent aab608d commit 495fdd5

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
workflow_dispatch:
10+
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
linting:
17+
name: Linting
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: 3.12
27+
architecture: x64
28+
29+
- name: Install dependencies
30+
run: |
31+
pip install ".[tests]"
32+
33+
- name: Run code analysis (black, mypy, flake8, pylint)
34+
run: |
35+
make code-analysis
36+
37+
build:
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
# NOTE: macos-13 is a workaround for an issue with the latest version
42+
os: [ubuntu-latest, macos-13, windows-latest]
43+
python: [3.9, "3.10", 3.11, 3.12]
44+
name: ${{ matrix.os }} Python ${{ matrix.python }}
45+
runs-on: ${{ matrix.os }}
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.python }}
53+
architecture: x64
54+
55+
- name: Install
56+
run: |
57+
# NOTE: pip, setuptools and wheel should be included with any python
58+
# installation. It's being installed/upgraded here because the
59+
# setup-python action is not including setuptools with Python 3.12
60+
pip install --upgrade pip setuptools wheel
61+
pip install .[tests,optional,docs]
62+
63+
- name: Test library
64+
run: |
65+
make test
66+
67+
- name: Upload coverage to codecov
68+
uses: codecov/codecov-action@v4
69+
with:
70+
files: ./coverage.xml
71+
fail_ci_if_error: false
72+
token: ${{ secrets.CODECOV_TOKEN }}
73+
slug: DataResponsibly/sharp
74+
75+
- name: Test Docs
76+
run: |
77+
cd doc
78+
make html

0 commit comments

Comments
 (0)