-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
796f680
commit e9f0ba9
Showing
18 changed files
with
7,470 additions
and
5,502 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ubuntu:23.10 | ||
RUN apt-get update && apt-get install -y zsh python3-setuptools pipenv npm | ||
|
||
# chromium dependencies | ||
RUN apt-get install -y fonts-noto-color-emoji libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxdamage1 libpango-1.0-0 libcairo2 libasound2 | ||
|
||
USER ubuntu |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["editorconfig.editorconfig", "ms-python.python", "Lencerf.beancount"] | ||
} | ||
}, | ||
"postCreateCommand": "make deps", | ||
"forwardPorts": [5000] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,24 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo pip3 install black | ||
sudo npm install -g prettier | ||
- name: Build frontend | ||
run: make build | ||
|
||
- name: Install fava-portfolio-returns | ||
run: pip3 install . | ||
|
||
- name: Start Fava | ||
run: cd example; fava example.beancount & | ||
|
||
- name: Run HTML tests | ||
run: cd frontend; npm run test -- -t HTML | ||
|
||
- name: Run formatter | ||
run: | | ||
make format | ||
git diff --exit-code | ||
- name: Build and run dev container task | ||
uses: devcontainers/[email protected] | ||
with: | ||
runCmd: make ci |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
frontend/node_modules: frontend/package-lock.json | ||
cd frontend; npm install | ||
touch -m frontend/node_modules | ||
deps-js: | ||
cd frontend; npm install && npx puppeteer browsers install chrome | ||
|
||
.PHONY: build | ||
build: frontend/node_modules | ||
deps-py: | ||
cd example; pipenv install -d | ||
|
||
deps: deps-js deps-py | ||
|
||
build-js: | ||
cd frontend; npm run build | ||
|
||
.PHONY: watch | ||
watch: frontend/node_modules | ||
watch-js: | ||
cd frontend; npm run watch | ||
|
||
.PHONY: test | ||
test: frontend/node_modules | ||
cd frontend; npm run test | ||
test-js: | ||
cd frontend; LANG=en npm run test | ||
|
||
test-js-update: | ||
cd frontend; LANG=en npm run test -- -u | ||
|
||
run: | ||
cd example; pipenv run fava example.beancount | ||
|
||
.PHONY: format | ||
format: | ||
prettier -w frontend src/fava_portfolio_returns/templates/*.css | ||
black src/fava_portfolio_returns/__init__.py | ||
find example -name '*.beancount' -exec bean-format -c 59 -o "{}" "{}" \; | ||
cd frontend; npx prettier -w . ../src/fava_portfolio_returns/templates/*.css | ||
cd example; pipenv run black ../src/fava_portfolio_returns/__init__.py | ||
cd example; find . -name '*.beancount' -exec pipenv run bean-format -c 59 -o "{}" "{}" \; | ||
|
||
ci: | ||
make run & | ||
make test-js | ||
make format | ||
git diff --exit-code |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.