Skip to content

Commit

Permalink
CH552G (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenwoodFox authored May 17, 2023
1 parent 8cc03c2 commit e8a76de
Show file tree
Hide file tree
Showing 22 changed files with 224,285 additions and 23 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/firmware_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Firmware Workflow

on:
push:
branches:
- "main"
tags:
- "*"
pull_request:

jobs:
make_firmware:
runs-on: ubuntu-latest
name: Firmware Builder

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: cd Firmware && make

- uses: actions/upload-artifact@v2
with:
name: ButtonBinaries
path: Firmware/.pio/build/attiny85/firmware.*

delint:
runs-on: ubuntu-latest
name: Delinter

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run Delinter
run: cd Firmware && pio check
164 changes: 164 additions & 0 deletions .github/workflows/hardware_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Button Hardware

on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
paths:
- "Hardware/**"

jobs:
KiCad_Hardware:
runs-on: ubuntu-latest
name: KiCad Hardware

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- uses: INTI-CMNB/KiBot@v2_k7
with:
# Config file
config: Hardware/config.kibot.yaml
# Prefix for output in config file.
dir: _hardwareOutput

# Hardware Files
schema: "Hardware/SuperButton/SuperButton.kicad_sch"
board: "Hardware/SuperButton/SuperButton.kicad_pcb"

- name: upload results
uses: actions/upload-artifact@v2
with:
name: Board-Hardware
path: _hardwareOutput

- name: Discord notification if failed
if: ${{ failure() }}
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
args: "Building new board failed, most likely a DRC check."

# make_docs:
# runs-on: ubuntu-latest
# name: Build Docs
# needs: [KiCad_Hardware]

# steps:
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# architecture: x64

# - uses: actions/checkout@v2
# with:
# fetch-depth: 0

# - run: sudo apt update

# - run: sudo apt install texlive-latex-recommended texlive-latex-extra texlive-pictures pandoc rename latexmk inkscape imagemagick

# - name: Install requirements
# run: pip install -r Docs/requirements.txt

# # Download artifacts from other builds
# - uses: actions/download-artifact@v2
# with:
# name: Board-Hardware
# path: _hardwareOutput

# # Convert svg graphics
# - run: convert -density 300 _hardwareOutput/LC-Mainboard-schematic.svg _hardwareOutput/LC-Mainboard-schematic.png

# - run: cd Docs && make latexpdf

# - run: mv Docs/_build/latex/*.pdf Docs/_build/latex/Board-Manual.pdf

# - uses: actions/upload-artifact@v2
# with:
# name: Board-Manual
# path: Docs/_build/latex/Board-Manual.pdf

dev-publish:
# publish only to devs
runs-on: ubuntu-latest
name: Dev-Publish
# needs: [make_docs, KiCad_Hardware]
needs: [KiCad_Hardware]

steps:
# Download artifacts
# - uses: actions/download-artifact@v2
# with:
# name: Board-Manual

- uses: actions/download-artifact@v2
with:
name: Board-Hardware

# - name: send custom message with args
# uses: appleboy/discord-action@master
# with:
# webhook_id: ${{ secrets.WEBHOOK_ID }}
# webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
# file: "Board-Manual.pdf"
# args: Display Board Just got an update!

- name: send custom message with args
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
file: "SuperButton-3D_top.png"

publish:
# Only run on tags
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
name: Publish
# needs: [make_docs, KiCad_Hardware]
needs: [KiCad_Hardware]

steps:
# Be in our repo
- uses: actions/checkout@v2
with:
fetch-depth: 0

# Download artifacts
# - uses: actions/download-artifact@v2
# with:
# name: Board-Manual

- uses: actions/download-artifact@v2
with:
name: Board-Hardware

- run: mkdir -p _staging/

# - run: cp *.pdf _staging/

- run: cp *.step _staging/

# Copy gerbers
- run: cp PCBWay/*.zip _staging/Board-$(git rev-parse --short HEAD)-PCBWay.zip
- run: cp JLCPCB/*.zip _staging/Board-$(git rev-parse --short HEAD)-JLCPCB.zip

- name: Upload Docs to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "_staging/*"
tag: ${{ github.ref }}
overwrite: true
prerelease: true
body: "Concord Robotics, Automated with github ci/cd."
file_glob: true
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "Hardware/SuperButton/Libraries/1721-kicad-libraries"]
path = Hardware/SuperButton/Libraries/1721-kicad-libraries
url = https://github.com/FRC-1721/1721-kicad-libraries
[submodule "Hardware/SuperButton/Libraries/keyswitch-kicad-library"]
path = Hardware/SuperButton/Libraries/keyswitch-kicad-library
url = https://github.com/perigoso/keyswitch-kicad-library.git
[submodule "Hardware/SuperButton/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/SuperButton/Libraries/kenwoodfox-kicad-libraries
url = https://github.com/KenwoodFox/kenwoodfox-kicad-libraries.git
Binary file added CAD/Assembly.FCStd
Binary file not shown.
Binary file added CAD/Base.FCStd
Binary file not shown.
Loading

0 comments on commit e8a76de

Please sign in to comment.