CI #1338
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |