mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-18 19:41:11 +02:00
ci: workflow to check bundle files (#2126)
fail if `bundle.min.css` or `bundle.min.js` differes from a `make bundle` output Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
28
.github/workflows/lint.yml
vendored
28
.github/workflows/lint.yml
vendored
@@ -3,25 +3,53 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
black:
|
black:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9", "3.10"]
|
||||||
with:
|
with:
|
||||||
make: checkblack
|
make: checkblack
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
ruff:
|
ruff:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9", "3.10"]
|
||||||
with:
|
with:
|
||||||
make: checkruff
|
make: checkruff
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
mypy:
|
mypy:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9", "3.10"]
|
||||||
with:
|
with:
|
||||||
make: mypy
|
make: mypy
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
pyright:
|
pyright:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9", "3.10"]
|
||||||
with:
|
with:
|
||||||
make: pyright
|
make: pyright
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
npm: true
|
npm: true
|
||||||
|
|
||||||
|
|
||||||
prettier:
|
prettier:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
with:
|
with:
|
||||||
make: checkprettier
|
make: checkprettier
|
||||||
npm: true
|
npm: true
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
uses: ./.github/workflows/make.yml
|
||||||
|
with:
|
||||||
|
make: checkbundle
|
||||||
|
npm: true
|
||||||
|
9
.github/workflows/make.yml
vendored
9
.github/workflows/make.yml
vendored
@@ -11,21 +11,24 @@ on:
|
|||||||
description: "use npm install"
|
description: "use npm install"
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
python-version:
|
||||||
|
description: "python version"
|
||||||
|
type: string
|
||||||
|
default: "3.10"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make:
|
make:
|
||||||
name: ${{ inputs.make }} (${{ matrix.python-version }})
|
name: ${{ inputs.make }} (${{ inputs.python-version }})
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os-version: ["ubuntu-latest"]
|
os-version: ["ubuntu-latest"]
|
||||||
python-version: ["3.9", "3.10"]
|
|
||||||
node-version: ["18.x"]
|
node-version: ["18.x"]
|
||||||
runs-on: ${{ matrix.os-version }}
|
runs-on: ${{ matrix.os-version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/prepare
|
- uses: ./.github/actions/prepare
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
npm: ${{ inputs.npm }}
|
npm: ${{ inputs.npm }}
|
||||||
- run: make ${{ inputs.make }}
|
- run: make ${{ inputs.make }}
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -35,6 +35,8 @@ coverage.xml
|
|||||||
node_modules
|
node_modules
|
||||||
lnbits/static/bundle.js
|
lnbits/static/bundle.js
|
||||||
lnbits/static/bundle.css
|
lnbits/static/bundle.css
|
||||||
|
lnbits/static/bundle.min.js.old
|
||||||
|
lnbits/static/bundle.min.css.old
|
||||||
docker
|
docker
|
||||||
|
|
||||||
# Nix
|
# Nix
|
||||||
|
10
Makefile
10
Makefile
@@ -100,6 +100,16 @@ bundle:
|
|||||||
sed -i -e "s/CACHE_VERSION =.*/CACHE_VERSION = $$(awk '/CACHE_VERSION =/ { print 1+$$4 }' lnbits/static/js/service-worker.js)/" \
|
sed -i -e "s/CACHE_VERSION =.*/CACHE_VERSION = $$(awk '/CACHE_VERSION =/ { print 1+$$4 }' lnbits/static/js/service-worker.js)/" \
|
||||||
lnbits/static/js/service-worker.js
|
lnbits/static/js/service-worker.js
|
||||||
|
|
||||||
|
checkbundle:
|
||||||
|
cp lnbits/static/bundle.min.js lnbits/static/bundle.min.js.old
|
||||||
|
cp lnbits/static/bundle.min.css lnbits/static/bundle.min.css.old
|
||||||
|
make bundle
|
||||||
|
diff -q lnbits/static/bundle.min.js lnbits/static/bundle.min.js.old || exit 1
|
||||||
|
diff -q lnbits/static/bundle.min.css lnbits/static/bundle.min.css.old || exit 1
|
||||||
|
@echo "Bundle is OK"
|
||||||
|
rm lnbits/static/bundle.min.js.old
|
||||||
|
rm lnbits/static/bundle.min.css.old
|
||||||
|
|
||||||
install-pre-commit-hook:
|
install-pre-commit-hook:
|
||||||
@echo "Installing pre-commit hook to git"
|
@echo "Installing pre-commit hook to git"
|
||||||
@echo "Uninstall the hook with poetry run pre-commit uninstall"
|
@echo "Uninstall the hook with poetry run pre-commit uninstall"
|
||||||
|
Reference in New Issue
Block a user