Add npm test github actions workflow

This commit is contained in:
Reckless_Satoshi 2022-07-13 13:40:58 -07:00
parent 03e4bbc1a5
commit a7cb34e55f
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 46 additions and 2 deletions

View File

@ -1,6 +1,7 @@
name: Django Tests
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths: ["api", "chat", "control", "robosats"]
@ -23,7 +24,8 @@ jobs:
python-version: ["3.10.2"]
steps:
- uses: actions/checkout@v3
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v3
with:

42
.github/workflows/frontend-tests.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Frontend Tests
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths: [ "frontend" ]
pull_request:
branches: [ "main" ]
paths: [ "frontend" ]
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
env:
DEVELOPMENT: 1
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup node'
uses: actions/setup-node@v3
with:
node-version: 16.16.0
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: 'Install NPM Dependencies'
run: |
cd frontend
npm install
- name: 'Tests'
run: |
cd frontend
npm test

View File

@ -708,7 +708,7 @@ class UserView(APIView):
image_path = avatar_path.joinpath(nickname + ".png")
if not image_path.exists():
with open(image_path, "wb") as f:
rh.img.save(f, format="png")
rh.img.save(f, format="png", optimize=True)
# Create new credentials and login if nickname is new
if len(User.objects.filter(username=nickname)) == 0: