[POWEROPS-2539] refactor: auth #2101
Workflow file for this run
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: build | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
PYTHON_VERSION: "3.10" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
environment: CI | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
# The installation is required as mypy must be run in the local system environment, not in the pre-commit environment. | |
- name: Install required dependencies | |
run: | | |
python3 -m pip install --upgrade pip poetry | |
poetry config virtualenvs.create false | |
poetry install | |
- name: Linting and static code checks | |
run: | | |
pre-commit run --all-files | |
tests: | |
runs-on: ubuntu-latest | |
environment: CI | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install core dependencies | |
run: | | |
python3 -m pip install --upgrade pip poetry | |
poetry config virtualenvs.create false | |
poetry install | |
- name: Test | |
env: | |
SETTINGS__COGNITE__CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
SETTINGS__COGNITE__CLIENT_ID: ${{ vars.CLIENT_ID }} | |
SETTINGS__COGNITE__PROJECT: ${{ vars.PROJECT }} | |
SETTINGS__COGNITE__CDF_CLUSTER: ${{ vars.CLUSTER }} | |
SETTINGS__COGNITE__TENANT_ID: ${{ vars.TENANT_ID }} | |
SETTINGS__COGNITE__LOGIN_FLOW: "client_credentials" | |
run: pytest --cov --cov-report term --cov-report xml:coverage.xml | |
- uses: codecov/codecov-action@v4 | |
if: matrix.python-version == ${{ env.PYTHON_VERSION }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build package | |
run: poetry build | |
build-docs: | |
runs-on: ubuntu-latest | |
environment: CI | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade --upgrade-strategy eager --no-cache-dir .[docs] | |
- name: Build documentation | |
run: | | |
mkdocs build |