-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (70 loc) · 1.99 KB
/
cicd.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: cicd
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
image_tag_version:
- 3.1.3
- 3.2.3
- 3.3.3
- 3.4.3
- 3.5.3
- 3.6.3
- 3.7.2
- 3.8.3
runs-on: ubuntu-latest
container: ghcr.io/osgeo/gdal:ubuntu-small-${{ matrix.image_tag_version }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends git python3-pip
pip3 install setuptools
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
- name: Check code style with black
run: black --check .
- name: Check imports ordering with isort
run: isort -c .
- name: Lint with flake8
run: flake8 .
- name: Test with pytest
run: pytest --cov=gdal_boots
release:
runs-on: ubuntu-latest
needs:
- test
if: ${{ github.repository == 'habibutsu/gdal-boots' && github.event_name == 'push' && github.ref_name == 'main' }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Configuring
run: |
pip install python-semantic-release==7.31.3
git fetch --tags
git config --global user.name "semantic-release"
git config --global user.email "semantic-release"
- name: Python Semantic Release
env:
CI: 'true'
GITHUB_ACTIONS: 'true'
REPOSITORY_USERNAME: ${{ secrets.PYPI_USER }}
REPOSITORY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
REPOSITORY_URL: https://pypi.onesoil.ai
run: semantic-release publish -D branch=${{ github.ref_name }}