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.
Merge pull request #1 from FRC-1721/feat/template
Feat/template
- Loading branch information
Showing
22 changed files
with
2,496 additions
and
1 deletion.
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,111 @@ | ||
name: Robot Workflow | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "*" | ||
pull_request: | ||
|
||
jobs: | ||
formatblack: | ||
name: Style Check Code with Black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check files using the black formatter | ||
uses: rickstaa/action-black@v1 | ||
id: action_black | ||
with: | ||
black_args: "." | ||
|
||
- name: Annotate diff changes using reviewdog | ||
if: steps.action_black.outputs.is_formatted == 'true' | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: blackfmt | ||
|
||
- name: Fail if actions taken | ||
if: steps.action_black.outputs.is_formatted == 'true' | ||
run: exit 1 | ||
|
||
- name: Discord notification | ||
if: ${{ failure() }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: "Black formatter reported errors in {{ EVENT_PAYLOAD.pull_request.html_url }} !" | ||
|
||
run_simulator: | ||
name: Run the WPIlib Simulator | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install pipenv | ||
run: | | ||
python -m pip install --upgrade pipenv wheel | ||
- id: cache-pipenv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('rio/Pipfile.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
cd rio && pipenv install --deploy --dev | ||
- name: Timeout the simulator | ||
run: | | ||
cd rio && timeout 20 pipenv run python -m robotpy sim --nogui || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | ||
- name: Discord notification | ||
if: ${{ failure() }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: "<@614313406345904148> Simulator failed in {{ EVENT_PAYLOAD.pull_request.html_url }} !" | ||
|
||
unit_test: | ||
name: pyfrc Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install pipenv | ||
run: | | ||
python -m pip install --upgrade pipenv wheel | ||
- id: cache-pipenv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('rio/Pipfile.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
cd rio && pipenv install --deploy --dev | ||
- name: Run unit tests | ||
run: | | ||
cd rio && pipenv run python -m robotpy test -- -vs || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | ||
- name: Discord notification | ||
if: ${{ failure() }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: "<@614313406345904148> Unit tests failed in {{ EVENT_PAYLOAD.pull_request.html_url }} !" |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# 1721-Crescendo | ||
[](https://github.com/FRC-1721/1721-Crescendo/actions/workflows/robot-workflow.yml) | ||
|
||
# 1721-Crescendo |
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 @@ | ||
{"teamNumber": 1721} |
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,46 @@ | ||
# FRC 1721 Tidal Force | ||
# 2022 | ||
|
||
# Because robotpy is so easy to use, this is moreso a | ||
# collection of shortcuts, handy for doing simple scripts | ||
# and macros. | ||
|
||
.PHONY: help | ||
|
||
help: ## Prints this help message | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
sim: ## Run the simulator | ||
python -m robotpy sim | ||
|
||
|
||
deploy: ## Deploy to the robot (with console) | ||
python -m robotpy deploy --nc | ||
|
||
|
||
push: ## Deploy to the robot (push only, no console) | ||
python -m robotpy deploy | ||
|
||
|
||
download: ## Download robot requirements locally | ||
robotpy-installer download -r robot_requirements.txt | ||
|
||
|
||
install: ## Install requirements, run download first! | ||
robotpy-installer install -r robot_requirements.txt | ||
|
||
|
||
info: ## Shortcut to get information about the code already on the bot | ||
python -m robotpy deploy-info | ||
|
||
test: ## Run automated tests | ||
python -m robotpy test | ||
|
||
download-python: ## Download python (for robot) | ||
robotpy-installer download-python | ||
|
||
install-python: ## Install python (for robot) | ||
robotpy-installer install-python | ||
|
||
clean: ## Clean the repo | ||
git clean -fdX |
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,19 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
robotpy = {extras = ["rev", "ctre", "commands2", "navx"]} | ||
wpilib = {extras = ["all"]} | ||
pyyaml = "6.0" | ||
black = "*" | ||
|
||
[dev-packages] | ||
black = "*" | ||
|
||
[requires] | ||
python_version = "3.11" | ||
|
||
[pipenv] | ||
allow_prereleases = true |
Oops, something went wrong.