let's have a workflow

This commit is contained in:
Jeff Epler 2024-10-11 21:54:42 -05:00
parent 075cdd423d
commit f7d1de5a5f
4 changed files with 60 additions and 3 deletions

48
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Build cr100
on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: "blob:none"
fetch-depth: 0
submodules: true
- uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
# When changing this update what Windows grabs too!
release: '13.3.Rel1'
- run:
make -j$(nproc) dist
- uses: actions/upload-artifact@v4
with:
name: cr100
path: dist/
if-no-files-found: error
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: pre-commit
run: pip install pre-commit && pre-commit run --all

View file

@ -6,7 +6,7 @@
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 rev: v5.0.0
hooks: hooks:
- id: check-yaml - id: check-yaml
- id: end-of-file-fixer - id: end-of-file-fixer

View file

@ -3,7 +3,7 @@ all: uf2
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf build rm -rf build dist
build/Makefile: build/Makefile:
cmake -S . -B build cmake -S . -B build
@ -19,7 +19,7 @@ uf2: | build/Makefile
$(MAKE) -C build $(MAKE) -C build
.PHONY: flash .PHONY: flash
flash: build/cr100.uf2 flash: uf2
$(MAKE) -C build $(MAKE) -C build
_douf2 RPI-RP2 build/cr100.uf2 /dev/serial/by-id/usb-Raspberry_Pi_Pico_*-if00 _douf2 RPI-RP2 build/cr100.uf2 /dev/serial/by-id/usb-Raspberry_Pi_Pico_*-if00
@ -28,3 +28,11 @@ flash: build/cr100.uf2
# database. # database.
install-terminfo: install-terminfo:
tic -v cr100.terminfo tic -v cr100.terminfo
.PHONY: dist
dist: uf2
rm -rf dist
mkdir -p dist/bin dist/terminfo
cp build/cr100.uf2 dist/bin/
cp build/cr100.elf dist/bin
tic -o dist/terminfo cr100.terminfo

View file

@ -1,5 +1,6 @@
from dataclasses import dataclass from dataclasses import dataclass
class Bitmap: class Bitmap:
def __init__(self, width, height, color_count): def __init__(self, width, height, color_count):
self.width = width self.width = width