-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (88 loc) · 2.96 KB
/
python-package.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python
on:
push:
branches:
- 'main'
- 'develop'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
types: [opened, synchronize]
branches:
- 'develop'
jobs:
build-python:
runs-on: ubuntu-20.04
#runs-on: self-hosted
env:
EWOC_DATASHIP_VERSION: "0.8.7"
WORLDCEREAL_VERSION: "1.0.17"
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.8'
- name: Download Dataship
uses: robinraju/[email protected]
with:
repository: "WorldCereal/ewoc_dataship"
tag: "${{ env.EWOC_DATASHIP_VERSION }}"
fileName: "ewoc_dag-${{ env.EWOC_DATASHIP_VERSION }}.tar.gz"
token: ${{ secrets.CS_ORG_TOKEN }}
- name: Download WORLDCEREAL
uses: robinraju/[email protected]
with:
repository: "WorldCereal/wc-classification"
tag: "${{ env.WORLDCEREAL_VERSION }}"
fileName: "worldcereal-${{ env.WORLDCEREAL_VERSION }}.tar.gz"
token: ${{ secrets.CS_ORG_TOKEN }}
- name: Install dependencies
run: |
python -m pip install "pip<22" --upgrade
python -m pip install "setuptools<61" --upgrade
python -m pip install ewoc_dag-${{ env.EWOC_DATASHIP_VERSION }}.tar.gz
# python -m pip install worldcereal-${{ env.WORLDCEREAL_VERSION }}.tar.gz --extra-index-url https://artifactory.vgt.vito.be/api/pypi/python-packages/simple
- name: Analysing the code with pylint
run: |
python -m pip install pylint
pylint --output-format=text $(find -type f -name "*.py" ! -path "**/venv/**")
- name: Analysing the code with mypy
run: |
python -m pip install mypy
python -m pip install boto3-stubs
python -m pip install pandas-stubs
python -m pip install types-beautifulsoup4
python -m pip install types-requests
mypy src/
# - name: Run tests
# run: python -m unittest discover -s tests
- name: Build package
run: |
python -m pip install build
python -m build
- name: Upload Artifact
uses: actions/[email protected]
with:
name: distribution
path: ./dist
release-python:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build-python
steps:
- name: Download Artifact
uses: actions/[email protected]
with:
name: distribution
path: ./dist
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: false
files: |
dist/ewoc_classif-*.whl
dist/ewoc_classif-*.tar.gz