Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: setup ci build #15

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/tinygo-org/tinygo-dev:latest
steps:
- name: Work around CVE-2022-24765
# We're not on a multi-user machine, so this is safe.
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v4
- name: TinyGo version check
run: tinygo version
- name: Run build and smoke tests
run: make smoke-test
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

clean:
@rm -rf build

FMT_PATHS = ./

fmt-check:
@unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1

smoke-test:
@mkdir -p build
tinygo build -target pico-w -size short -o build/test.uf2 ./rp2-pio/examples/blinky
tinygo build -target pico-w -size short -o build/test.uf2 ./rp2-pio/examples/i2s
tinygo build -target pico-w -size short -o build/test.uf2 ./rp2-pio/examples/pulsar
tinygo build -target pico-w -size short -o build/test.uf2 ./rp2-pio/examples/tufty
tinygo build -target pico-w -size short -o build/test.uf2 ./rp2-pio/examples/ws2812b

test: clean fmt-check smoke-test
Loading