Skip to content

Merge pull request #2 from waylayio/chore/regenerate #6

Merge pull request #2 from waylayio/chore/regenerate

Merge pull request #2 from waylayio/chore/regenerate #6

Workflow file for this run

name: Waylay Queries CI
on:
push:
branches: [ "main", "staging", "release/**" ]
tags:
- '**'
pull_request:
branches: [ "main", "staging", "release/**" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Git with token to access other private repositories
run: git config --global url."https://${{ secrets.OTOMATOR_PAT }}@github".insteadOf https://github
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/*requirements*.txt'
- name: install dependencies
run: make ci-install-types
- name: code qa
run: make ci-code-qa
- name: unit tests
run: make ci-test
test-minimal:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Git with token to access other private repositories
run: git config --global url."https://${{ secrets.OTOMATOR_PAT }}@github".insteadOf https://github
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/*requirements*.txt'
- name: install dependencies
run: make ci-install-api
- name: unit tests
run: make ci-test
publish-api:
needs:
- test
- test-minimal
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
defaults:
run:
working-directory: ./waylay-sdk-queries
name: Publish api package to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/waylay-sdk-queries
permissions:
actions: read
contents: read
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: pip install build
- name: check version
id: check-tag
uses: samuelcolvin/[email protected]
with:
version_file_path: waylay-sdk-queries/src/waylay/services/queries/service/__init__.py
- name: Build
run: python3 -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: waylay-sdk-queries/dist
publish-types:
needs:
- test
- test-minimal
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
defaults:
run:
working-directory: ./waylay-sdk-queries-types
name: Publish types package to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/waylay-sdk-queries-types
permissions:
actions: read
contents: read
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: pip install build
- name: check version
id: check-tag
uses: samuelcolvin/[email protected]
with:
version_file_path: waylay-sdk-queries-types/src/waylay/services/queries/models/__init__.py
- name: Build
run: python3 -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: waylay-sdk-queries-types/dist