Skip to content
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
2 changes: 2 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ FROM rust:1.86.0-bullseye
RUN rustup target install thumbv6m-none-eabi
RUN cargo install flip-link --version 0.1.10
RUN rustup component add rustfmt
RUN rustup component add llvm-tools
RUN cargo install cargo-binutils
5 changes: 1 addition & 4 deletions .docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
services:
{{project-name}}:
build:
context: .
dockerfile: Dockerfile
image: "baker-link-env"
image: "bakerlinklab/bakerlink-env:latest"
container_name: "{{project-name}}-container"
volumes:
- "../:/{{project-name}}"
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Docker Image

on:
push:
branches: [main]
paths:
- '.docker/Dockerfile'
workflow_dispatch:

env:
DOCKER_IMAGE: bakerlinklab/bakerlink-env

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
# Requires repository secrets: DOCKERHUB_USERNAME and DOCKERHUB_TOKEN
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .docker
file: .docker/Dockerfile
push: true
tags: |
${{ env.DOCKER_IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"rust-analyzer.cargo.target": "thumbv6m-none-eabi",
"rust-analyzer.check.allTargets": false,
"editor.formatOnSave": true
}
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ rp2040-hal = { version = "0.10", features = ["rt", "critical-section-impl"] }
rp2040-boot2 = "0.3"
critical-section = "1.0.0"

[dev-dependencies]
defmt-test = "0.3"

[[test]]
name = "example_test"
harness = false

# cargo build/run
[profile.dev]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion cargo-generate.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[template]
ignore = ["README.md", "LICENSE"]
ignore = ["README.md", "LICENSE", ".github/"]
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "1.86.0"
targets = ["thumbv6m-none-eabi"]
components = ["rustfmt", "llvm-tools"]
20 changes: 20 additions & 0 deletions tests/example_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#![no_std]
#![no_main]

use defmt_rtt as _;
use panic_probe as _;
use rp2040_hal as _;

#[link_section = ".boot2"]
#[used]
pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H;

#[defmt_test::tests]
mod tests {
use defmt::assert;

#[test]
fn it_works() {
assert!(true);
}
}