[pre-commit.ci] pre-commit autoupdate #1470
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: CI tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
FORCE_COLOR: true | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
pre-commit: | |
name: Run linters and other pre-commit hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
working-directory: ./pydatalab | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U setuptools | |
pip install pipenv | |
pipenv sync --dev | |
pipenv run pip install invoke | |
pipenv run pip install -e . | |
- name: Run pre-commit | |
working-directory: ./pydatalab | |
run: | | |
pipenv run pre-commit run --all-files --show-diff-on-failure | |
pytest: | |
name: Run Python unit tests | |
services: | |
mongo: | |
image: mongo:3 | |
ports: | |
- 27017:27017 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
python-version: ["3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install latest compatible versions of immediate dependencies | |
working-directory: ./pydatalab | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U setuptools | |
pip install pipenv | |
pipenv sync --dev | |
pipenv run pip install -e . | |
pipenv graph | |
- name: Run all tests | |
working-directory: ./pydatalab | |
run: | | |
pipenv run pytest -rs -vvv --cov-report=term --cov-report=xml --cov ./pydatalab ./tests | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.10' && github.repository == 'the-grey-group/datalabvue' | |
uses: codecov/codecov-action@v3 | |
webapp: | |
name: Test the webapp | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
env: | |
FORCE_COLOR: 0 | |
with: | |
node-version: "16.15.0" | |
cache: "yarn" | |
cache-dependency-path: ./webapp/yarn.lock | |
- name: Install web app | |
working-directory: ./webapp | |
run: yarn install --frozen-lockfile | |
- name: Build web app | |
working-directory: ./webapp | |
run: yarn build | |
- name: Build the Docker images | |
run: | | |
echo "PYDATALAB_TESTING=true" >> pydatalab/.env | |
docker compose --profile prod build | |
- name: Start Docker images | |
run: | | |
# Create a named docker network that all containers attach to | |
docker network create nginx | |
docker compose --profile prod up -d --wait --no-build | |
- name: Run end-to-end tests | |
working-directory: ./webapp | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
run: | | |
yarn test:e2e --headless --url http://localhost:8081 --record | |
- name: Archive video from cypress | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Cypress video | |
path: /home/runner/work/datalabvue/datalabvue/webapp/cypress/videos/*.cy.js.mp4 | |
- name: Archive any failure screenshots from Cypress | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Cypress screenshots | |
path: /home/runner/work/datalabvue/datalabvue/webapp/cypress/screenshots/*/*.png |