Merge pull request #7 from waylayio/chore/regenerate #23
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: Waylay Alarms 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-alarms | |
name: Publish api package to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/waylay-sdk-alarms | |
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-alarms/src/waylay/services/alarms/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-alarms/dist | |
publish-types: | |
needs: | |
- test | |
- test-minimal | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
defaults: | |
run: | |
working-directory: ./waylay-sdk-alarms-types | |
name: Publish types package to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/waylay-sdk-alarms-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-alarms-types/src/waylay/services/alarms/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-alarms-types/dist |