Fix provision_s3.sh
script
#1680
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: Run Miner QA | |
on: | |
push: | |
branches: [master, main] | |
pull_request: | |
branches: [master, main] | |
env: | |
PYTHON_DEFAULT_VERSION: "3.11" | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./miner | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
cache: "pip" | |
- name: Install dependencies | |
run: python -m pip install --upgrade nox 'pdm==2.19.3' | |
- name: Create dotenv file | |
run: cp ./envs/dev/.env.template .env | |
- name: Run linters check | |
run: nox -vs lint | |
type_check: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./miner | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
cache: "pip" | |
- name: Install dependencies | |
run: python -m pip install --upgrade nox 'pdm==2.19.3' | |
- name: Create dotenv file | |
run: cp ./envs/dev/.env.template .env | |
- name: Run mypy | |
run: nox -vs type_check | |
test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./miner | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
cache: "pip" | |
- name: Install dependencies | |
run: python -m pip install --upgrade nox 'pdm==2.19.3' | |
- name: Setup common virtualenv | |
# In order not to exhaust disk on GitHub runner, we use one single | |
# virtualenv for all pdm projects: miner, executor, validator. | |
run: | | |
pdm config venv.backend venv | |
python -m venv .venv | |
echo "$.venv/bin" >> $GITHUB_PATH | |
echo "VIRTUAL_ENV=${{ github.workspace }}/.venv" >> $GITHUB_ENV | |
echo "PDM_IGNORE_SAVED_PYTHON=1" >> $GITHUB_ENV | |
- name: Prepare environment | |
run: ./setup-dev.sh | |
- name: Run dockerized services | |
run: docker compose up -d --wait | |
- name: Run migrations | |
run: cd app/src && pdm run python manage.py wait_for_database --timeout 120 && pdm run python manage.py migrate | |
- name: Run unit tests | |
run: pdm run nox -vs test --no-venv | |
- name: Stop dockerized services | |
if: success() || failure() | |
run: docker compose down -v |