-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (75 loc) · 2.83 KB
/
ci.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
name: CI
on:
push:
branches:
- '**' #double star includes a '/'. single star doesnt match a '/'
tags:
- '**' #double star includes a '/'. single star doesnt match a '/'
schedule:
# Daily at 05:44
- cron: '44 5 * * *'
defaults:
run:
shell: bash
env:
PYTHON_VERSION: 3.8
AWS_REGION: us-east-2
jobs:
build:
name: CI
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Setup Venv
run: |
#install Poetry
python3 -m ensurepip
python3 -m pip install --upgrade pip
python3 -m pip install poetry==1.5.1
poetry --version
poetry config virtualenvs.in-project true
poetry config virtualenvs.path .
#Setup AWS Connection
export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain epc-power-us --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --query authorizationToken --output text`
poetry config repositories.epc-power https://epc-power-us-${{ secrets.AWS_ACCOUNT_ID }}.d.codeartifact.us-east-2.amazonaws.com/pypi/epc-power/
poetry config http-basic.epc-power aws $CODEARTIFACT_AUTH_TOKEN
poetry config repositories.third-party https://epc-power-us-${{ secrets.AWS_ACCOUNT_ID }}.d.codeartifact.us-east-2.amazonaws.com/pypi/third-party/
poetry config http-basic.third-party aws $CODEARTIFACT_AUTH_TOKEN
poetry config installer.max-workers 1 # https://github.com/python-poetry/poetry/issues/7611
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install
poetry --version
- name: python commands
run: |
set -vx
poetry run pip --version
poetry run black --check --diff .
poetry run genbuildinfo "epyqlib/_build_generated.py"
poetry run pip freeze --all
poetry run builduiepyqlib
poetry run pytest -vvvv -s --no-qt-log --run-factory epyqlib.tests --pyargs
poetry build
- name: Publish executable
#only run if a new tag is created
if: startsWith(github.ref, 'refs/tags/')
run: |
poetry publish --repository epc-power
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: epyq_st
path: |
dist/*