chore: move all 'disposable' components into one module #355
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: [push] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.6 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 3306/tcp | |
# needed because the mysql container does not provide a healthcheck | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up project using python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Run all pre-commit hooks on all the files. | |
# Getting only staged files can be tricky in case a new PR is opened | |
# since the action is run on a branch in detached head state | |
- name: Install and run pre-commit | |
uses: pre-commit/[email protected] | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox -r | |
env: | |
# Use localhost for the host here because we are running the job on the | |
# VM. If we were running the job on in a container this would be mysql. | |
MYSQL_TEST_DB_HOST: localhost | |
MYSQL_TEST_DB_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port | |
MYSQL_TEST_DB_NAME: mysql | |
MYSQL_TEST_DB_USERNAME: root | |
MYSQL_TEST_DB_PASSWORD: "" |