Try out mkdocs-material #1083
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: CI | |
on: | |
# We would like to trigger for CI for any pull request action - | |
# both from QuantCo's branches as well as forks. | |
pull_request: | |
types: [opened, labeled, unlabeled, synchronize] | |
# In addition to pull requests, we want to run CI for pushes | |
# to the main branches and tags. | |
push: | |
branches: | |
- "main" | |
- "pre-commit-autoupdate" | |
tags: | |
- "v*" | |
jobs: | |
pre-commit-checks: | |
name: Pre-commit Checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: default lint | |
- name: pre-commit | |
run: pixi run pre-commit-run --color=always --show-diff-on-failure | |
unit-tests: | |
name: "unit tests" | |
strategy: | |
fail-fast: true | |
matrix: | |
env: | |
- py38 | |
- py39 | |
- py310 | |
- py311 | |
- py312 | |
- sa1 | |
- sa2 | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage --color=yes | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
mssql: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'sqlserver') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
name: "mssql" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- mssql-py38 | |
- mssql-py39 | |
- mssql-py310 | |
- mssql-py311 | |
- mssql-py312 | |
- mssql-sa1 | |
- mssql-sa2 | |
services: | |
DB: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: datajudge-123 | |
ports: | |
- 1433:1433 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
# TODO: Consider removing this manual installation since the docker image already comes with a msodbc driver. | |
- name: Install msodbcsql17 driver | |
run: | | |
wget https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.9.1.1-1_amd64.deb | |
ACCEPT_EULA=Y sudo apt install ./msodbcsql17_17.9.1.1-1_amd64.deb --allow-downgrades | |
- name: Wait for SQL Server | |
timeout-minutes: 1 | |
run: until docker logs "${{ job.services.db.id }}" 2>&1 | grep -q "SQL Server is now ready"; do sleep 10; done | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage --color=yes | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
postgres: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'postgres') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
name: PostgreSQL | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
postgres_version: | |
- latest | |
- 11 | |
env: | |
- postgres-py38 | |
- postgres-py39 | |
- postgres-py310 | |
- postgres-py311 | |
- postgres-py312 | |
- postgres-sa1 | |
- postgres-sa2 | |
services: | |
DB: | |
image: postgres:${{ matrix.postgres_version }} | |
env: | |
POSTGRES_USER: datajudge | |
POSTGRES_PASSWORD: datajudge | |
POSTGRES_DB: datajudge | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage --color=yes | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
db2: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'db2') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
name: DB2 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- db2-py38 | |
- db2-py39 | |
- db2-py310 | |
- db2-sa1 | |
services: | |
DB: | |
image: ibmcom/db2:11.5.5.1 | |
env: | |
LICENSE: accept | |
DB2INSTANCE: db2inst1 | |
DB2INST1_PASSWORD: password | |
DBNAME: testdb | |
UPDATEAVAIL: "NO" | |
options: --privileged | |
ports: | |
- 50000:50000 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
- name: Wait for db2 to load | |
timeout-minutes: 2 | |
run: until docker logs "${{ job.services.db.id }}" 2>&1 | grep -q 'Setup has completed.'; do sleep 5; done | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage --color=yes | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
snowflake: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'snowflake') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
name: "Snowflake" | |
runs-on: ubuntu-latest | |
env: | |
SNOWFLAKE_USER: DATAJUDGE | |
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- snowflake-py38 | |
- snowflake-sa1 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage --color=yes | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# The authentication of these tests is currently failing. | |
# These tests should be reenabled asap. | |
# bigquery: | |
# if: ${{ contains(github.event.pull_request.labels.*.name, 'bigquery') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
# name: "BigQuery" | |
# runs-on: ubuntu-latest | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# env: | |
# - bigquery-py38 | |
# - bigquery-sa1 | |
# steps: | |
# - name: 'Authenticate to Google Cloud' | |
# uses: 'google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa' | |
# with: | |
# credentials_json: '${{ secrets.GCP_KEY }}' | |
# - name: Checkout branch | |
# uses: actions/checkout@v4 | |
# - name: Set up pixi | |
# uses: prefix-dev/[email protected] | |
# with: | |
# environments: ${{ matrix.env }} | |
# - run: | | |
# pixi run -e ${{ matrix.env }} postinstall | |
# pixi run -e ${{ matrix.env }} coverage | |
# - name: Generate code coverage report | |
# uses: codecov/[email protected] | |
# with: | |
# file: ./coverage.xml | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
impala: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'impala') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} | |
name: "Impala" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- impala-py38 | |
- impala-sa1 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up container | |
run: docker compose up --wait impala | |
- name: Set up pixi | |
uses: prefix-dev/[email protected] | |
with: | |
environments: ${{ matrix.env }} | |
- run: | | |
pixi run -e ${{ matrix.env }} postinstall | |
pixi run -e ${{ matrix.env }} coverage | |
- name: Generate code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |