Skip to content

add write permission to gh workflow #20

add write permission to gh workflow

add write permission to gh workflow #20

Workflow file for this run

name: Lint-Unit-Test
on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
jobs:
Lints:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.7.1"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run : make setup.project
- run : make lints.ci
Unit-Test-Ubuntu:
needs: Lints
strategy:
matrix:
python-version: ["3.9", "3.11"]
poetry-version: ["1.7.1"]
os: [ubuntu]
runs-on: ${{ matrix.os }}-latest
env:
OPSML_TESTING: 1
LOG_LEVEL: DEBUG
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : |
rm -rf /opt/hostedtoolcache/CodeQL
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
rm -rf /opt/hostedtoolcache/Ruby
rm -rf /opt/hostedtoolcache/go
rm -rf /opt/hostedtoolcache/node
make setup.project
make test.unit
Unit-Test-MacOS:
needs: Lints
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.7.1"]
os: [macos]
runs-on: ${{ matrix.os }}-12
env:
OPSML_TESTING: 1
LOG_LEVEL: DEBUG
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : make setup.project
- run : make test.unit
Unit-Test-310-Coverage:
needs: Lints
strategy:
matrix:
python-version: ["3.10"]
poetry-version: ["1.7.1"]
os: [ubuntu]
runs-on: ${{ matrix.os }}-latest
env:
OPSML_TESTING: 1
LOG_LEVEL: DEBUG
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : |
rm -rf /opt/hostedtoolcache/CodeQL
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
rm -rf /opt/hostedtoolcache/Ruby
rm -rf /opt/hostedtoolcache/go
rm -rf /opt/hostedtoolcache/node
sudo apt clean
make setup.project
make test.unit
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
Unit-Test-Windows:
needs: Lints
strategy:
matrix:
python-version: ["3.10"]
poetry-version: ["1.7.1"]
os: [windows]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : make setup.project
- run : make test.unit
Postgres-Unit:
needs: [Unit-Test-Ubuntu,Unit-Test-MacOS, Unit-Test-Windows, Unit-Test-310-Coverage]
runs-on: ubuntu-latest
env:
OPSML_TESTING: 1
LOG_LEVEL: DEBUG
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.7.1"]
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : make setup.project
- run : make test.registry
env:
OPSML_TRACKING_URI: postgresql://postgres:postgres@localhost:5432/postgres?connect_timeout=5&sslmode=disable
MySql-Unit:
needs: [Unit-Test-Ubuntu,Unit-Test-MacOS, Unit-Test-Windows, Unit-Test-310-Coverage]
runs-on: ubuntu-latest
env:
OPSML_TESTING: 1
LOG_LEVEL: DEBUG
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.7.1"]
services:
mysql:
image: mysql:8.2
env:
MYSQL_DATABASE: mysql
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
# Set health checks to wait until postgres has started
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
--name=mysql-test
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libmysqlclient-dev libgirepository1.0-dev
pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run : make setup.project
- run : make test.registry
env:
OPSML_TRACKING_URI: mysql+pymysql://[email protected]:3306/mysql?connect_timeout=5