-
Notifications
You must be signed in to change notification settings - Fork 45
113 lines (93 loc) · 2.74 KB
/
onpush.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
107
108
109
110
111
112
113
name: build
on:
pull_request:
types: [ opened, synchronize ]
push:
branches: [ main ]
release:
types: [ created ]
jobs:
test-pipeline:
runs-on: ${{ matrix.os }}
container:
image: python:${{ matrix.python-version }}
options: --user 1001 # run as the runner user instead of root
strategy:
max-parallel: 2
matrix:
python-version: [ '3.8' ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3 # use latest version of the checkout action
- name: Set up JDK # used for py4j for cronutils
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Install pip
run: python -m pip install --upgrade pip
- name: Setup Node 16
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Install cdktf
run: |
npm install -g cdktf-cli
cdktf --help
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install poetry and build tools
run: |
export PATH=$PATH:$HOME/.local/bin
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
run: |
export PATH=$PATH:$HOME/.local/bin
make poetry
- name: Install, lint and test
run: |
export PATH=$PATH:$HOME/.local/bin
export GITHUB_ACTIONS=true
make cov
deploy:
name: Deploy to PyPi
runs-on: ubuntu-latest
needs:
- test-pipeline
if: github.event_name == 'release'
steps:
- name: Set up JDK # used for py4j for cronutils
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Install pip
run: python -m pip install --upgrade pip
- name: Setup Node 16
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Install cdktf
run: |
npm install -g cdktf-cli
cdktf --help
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install build tools
run: |
export PATH=$PATH:$HOME/.local/bin
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
run: |
export PATH=$PATH:$HOME/.local/bin
make poetry
- name: Install wheel and twine
run: python -m pip install wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
export PATH=$PATH:$HOME/.local/bin
make build
twine upload dist/*