Skip to content

Commit

Permalink
Add CI job for avr-unknown-gnu-atmega328
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Jul 18, 2024
1 parent ee539c7 commit a1ebff0
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,51 @@ jobs:
- name: Build Documentation
run: cargo doc --no-deps

build-avr:
runs-on: ubuntu-latest

steps:
- name: Install build dependencies
shell: bash
run: |
env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm gcc-avr avr-libc libclang-dev
- name: Install rust
run: rustup toolchain install --profile minimal --component=rust-src nightly

- name: Configure target
run: |
cat <<EOT > avr-atmega328p.json
{
"arch": "avr",
"atomic-cas": false,
"cpu": "atmega328p",
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
"eh-frame-header": false,
"exe-suffix": ".elf",
"late-link-args": {
"gcc": [
"-lgcc"
]
},
"linker": "avr-gcc",
"llvm-target": "avr-unknown-unknown",
"max-atomic-width": 8,
"no-default-libraries": false,
"pre-link-args": {
"gcc": [
"-mmcu=atmega328p"
]
},
"relocation-model": "static",
"target-c-int-width": "16",
"target-pointer-width": "16"
}
EOT
- name: Patch delog
run: echo 'delog = { version = "0.1.6", git = "https://github.com/LechevSpace/delog.git", rev = "e83f3fd" }' >> Cargo.toml

- name: Build avr
run: cargo +nightly build -Z build-std=core --target=./avr-atmega328p.json --release

0 comments on commit a1ebff0

Please sign in to comment.