name: CI on: push: branches: - main pull_request: jobs: dist: runs-on: ubuntu-latest steps: - uses: actions/setup-python@v4 with: python-version: "3.10" - uses: actions/checkout@v3 - run: python -m pip install --upgrade pip build wheel twine - run: python -m build --sdist --wheel - run: python -m twine check dist/* standardjs: runs-on: ubuntu-latest steps: - uses: actions/setup-node@v3 with: node-version: '14.x' - uses: actions/checkout@v3 - id: cache-npm uses: actions/cache@v3 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install Node dependencies run: npm ci - run: npm run lint:js lint: runs-on: ubuntu-latest strategy: matrix: lint-command: - bandit -r . -x ./tests - black --check --diff . - flake8 . - isort --check-only --diff . - pydocstyle . steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: "3.10" cache: 'pip' cache-dependency-path: 'linter-requirements.txt' - run: python -m pip install -r linter-requirements.txt - run: ${{ matrix.lint-command }} pytest: needs: - lint - standardjs - dist runs-on: ubuntu-latest strategy: matrix: python-version: - "3.8" - "3.9" - "3.10" django-version: - "3.2" - "4.0" 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 Chrome run: | sudo apt update sudo apt install -y google-chrome-stable - name: Install Selenium run: | mkdir bin curl -qO "https://chromedriver.storage.googleapis.com/$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip" unzip chromedriver_linux64.zip -d bin - run: python -m pip install .[test] codecov - run: python -m pip install django~=${{ matrix.django-version }} - run: python -m pytest env: PATH: $PATH:$(pwd)/bin - run: codecov