This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
40 changed files
with
4,825 additions
and
115 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,75 @@ | ||
name: Makefile CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
make_dashboard: | ||
name: Build Dashboard | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
architecture: x64 | ||
|
||
- run: sudo apt update | ||
|
||
- run: sudo apt install curl | ||
|
||
- name: Install NPM | ||
run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | ||
|
||
- name: Install npm deps | ||
run: cd dashboard && npm ci | ||
|
||
- id: cache-pipenv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('dashboard/Pipfile.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
cd dashboard && pipenv install --deploy --dev | ||
- run: cd dashboard && pipenv run make stage | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Dashboard_Transpiled | ||
path: dashboard/dist | ||
|
||
publish: | ||
# Only run on tags | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
name: Publish | ||
needs: [make_dashboard] | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: Dashboard_Transpiled | ||
path: Dashboard_Transpiled/ | ||
|
||
- uses: papeloto/action-zip@v1 | ||
with: | ||
files: Dashboard_Transpiled/ | ||
dest: Dashboard_Transpiled.zip | ||
|
||
- name: Upload Dashboard to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: "*.zip" | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
prerelease: true | ||
body: "Tidal Force Robotics, Automated with github ci/cd." | ||
file_glob: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# FRC 1721 Tidal Force | ||
# 2023-2024 | ||
# | ||
|
||
ROOT := $(PWD) | ||
STAGEDIR := $(ROOT)/dist/ | ||
DASH_HASH := $(shell git describe --tags --always) | ||
|
||
all: help | ||
help: # List all commands and their descriptions | ||
@echo | ||
@cat Makefile | grep ': #' --color=never | sed '/^\t/d' | sed 's/: / /' | column -t -s '#' | ||
@echo | ||
|
||
ready: # Run the necessary commands for development | ||
pipenv install | ||
npm ci | ||
build: # Run `parcel build' and inject NetworkTables | ||
npm run build | ||
./build.sh | ||
run: # Run a live server of the dashboard | ||
cd dist && pipenv run python -m pynetworktables2js | ||
dev: # Automatically run `make build' whenever a file changes in src/ (requires program `entr') | ||
find src/ | entr sh -c 'make build' | ||
clean: # Run `git clean -fdX | ||
git clean -fdX | ||
stage: # Prepares dist/ for deployment | ||
rm -rf dist/ | ||
make build | ||
cp entrypoint.sh $(STAGEDIR) | ||
cp run.bat $(STAGEDIR) |
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 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
pynetworktables2js = {ref = "refs/pull/45/head", git = "git+https://github.com/robotpy/pynetworktables2js.git"} | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.11" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# FRC 1721 Dashboard | ||
## Getting Started | ||
- Make sure you have sed installed | ||
- Make sure Robot sim is running | ||
- Make sure npm is installed | ||
|
||
Make sure you are in the dashboard/ folder. | ||
|
||
Install deps | ||
|
||
``` sh | ||
npm ci | ||
``` | ||
|
||
Build webpage | ||
|
||
``` sh | ||
make build | ||
``` | ||
|
||
(NOT REQUIRED) You can build automatically when a file changes in src/ (requires 'entr', `paru -S entr` `paman install entr`) | ||
|
||
``` sh | ||
make dev | ||
``` | ||
|
||
Run webpage | ||
|
||
``` sh | ||
make run | ||
``` | ||
|
||
`make run` can be left running when you run `make build`, and doesn't need to be run again to update the webpage |
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 @@ | ||
sed -i -e 's/<p><\/p>/<script src="\/networktables\/networktables.js"><\/script><p><\/p>/g' dist/index.html | ||
sed -i -e 's/<p><\/p>/<script src="\/networktables\/utils.js"><\/script><p><\/p>/g' dist/index.html | ||
sed -i -e 's/<p><\/p>/<script src="\/networktables\/camera.js"><\/script>/g' dist/index.html | ||
|
||
sed -i -e "/<\!--FL-->/rsrc/asset/wheel/FL.svg" dist/index.html | ||
sed -i -e "/<\!--FR-->/rsrc/asset/wheel/FR.svg" dist/index.html | ||
sed -i -e "/<\!--RL-->/rsrc/asset/wheel/RL.svg" dist/index.html | ||
sed -i -e "/<\!--RR-->/rsrc/asset/wheel/RR.svg" dist/index.html | ||
sed -i -e "/<\!--FLd-->/rsrc/asset/wheel/FLd.svg" dist/index.html | ||
sed -i -e "/<\!--FRd-->/rsrc/asset/wheel/FRd.svg" dist/index.html | ||
sed -i -e "/<\!--RLd-->/rsrc/asset/wheel/RLd.svg" dist/index.html | ||
sed -i -e "/<\!--RRd-->/rsrc/asset/wheel/RRd.svg" dist/index.html |
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,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
|
||
python -m pynetworktables2js --port=5800 --robot=10.17.21.2 |
Oops, something went wrong.