Update publishing workflow (#57) #106
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: tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
syntax-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Python setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install test dependencies | |
run: pip install -r requirements-tests.txt | |
- name: Check syntax with black | |
run: black --check django_comments_ink | |
django: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django: ["4.1", "4.2", "5.0"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Python setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install tox and django | |
run: pip install tox "django==${{ matrix.django }}" | |
- name: Run unit tests | |
run: tox -e py3.12-django${{ matrix.django }} | |
javascript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm install | |
- run: npm test |