Routes/scouter #431
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: 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"] | |
node-version: ["22.5.1"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: "opsml/app/static/package-lock.json" | |
- name: Build App for testing | |
run: | | |
cd opsml/app/static | |
npm install | |
npm run build --if-present | |
npm run lints | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ 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] | |
node-version: ["22.5.1"] | |
runs-on: ${{ matrix.os }}-latest | |
env: | |
OPSML_TESTING: 1 | |
LOG_LEVEL: DEBUG | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: "opsml/app/static/package-lock.json" | |
- name: Build App for testing | |
run: | | |
cd opsml/app/static | |
npm install | |
npm run build --if-present | |
npm run test | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Build and tests | |
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] | |
node-version: ["22.5.1"] | |
runs-on: ${{ matrix.os }}-latest | |
env: | |
OPSML_TESTING: 1 | |
LOG_LEVEL: DEBUG | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: "opsml/app/static/package-lock.json" | |
- name: Build App for testing | |
run: | | |
cd opsml/app/static | |
npm install | |
npm run build --if-present | |
npm run test | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install Extras | |
run: | | |
brew install postgresql libomp | |
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" | |
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include" | |
- name: Setup Project | |
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 | |
- name: Unit Tests | |
run: make test.unit | |
Unit-Test-Coverage: | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
poetry-version: ["1.7.1"] | |
os: [ubuntu] | |
node-version: ["22.5.1"] | |
runs-on: ${{ matrix.os }}-latest | |
env: | |
OPSML_TESTING: 1 | |
LOG_LEVEL: DEBUG | |
OPSML_AUTH: True | |
OPSML_USERNAME: admin | |
OPSML_PASSWORD: admin | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: "opsml/app/static/package-lock.json" | |
- name: Build App for testing | |
run: | | |
cd opsml/app/static | |
npm install | |
npm run build --if-present | |
npm run test | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- 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.coverage | |
- 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.11"] | |
poetry-version: ["1.7.1"] | |
os: [windows] | |
node-version: ["22.5.1"] | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: "opsml/app/static/package-lock.json" | |
- name: Build App for testing | |
run: | | |
cd opsml/app/static | |
npm install | |
npm run build --if-present | |
npm run test | |
- name: Set up uv | |
run: irm https://astral.sh/uv/install.ps1 | iex | |
shell: powershell | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- run: make setup.project | |
- run: make test.unit | |
Postgres-Unit: | |
needs: | |
[Unit-Test-Ubuntu, Unit-Test-MacOS, Unit-Test-Windows, Unit-Test-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: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- 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-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 uv | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev libmysqlclient-dev libgirepository1.0-dev | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- run: make setup.project | |
- run: make test.registry | |
env: | |
OPSML_TRACKING_URI: mysql+pymysql://[email protected]:3306/mysql?connect_timeout=5 |