Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 51ef560

Browse files
authored
Merge pull request #42 from Mshivam2409/circleci-project-setup
Circleci Project Setup
2 parents da3c27d + ff90d3e commit 51ef560

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: cimg/rust:1.53.0
7+
8+
steps:
9+
- checkout
10+
- run:
11+
name: Install Toolchain
12+
command: bash toolchain.sh
13+
- run:
14+
name: Install AVR-GCC
15+
command : |
16+
sudo apt update
17+
sudo apt install -y gcc-avr avr-libc binutils-avr avrdude
18+
- run:
19+
name: Check formatting
20+
command: |
21+
rustfmt --version
22+
cargo fmt --all -- --check
23+
- run:
24+
name: Test Examples
25+
command: bash test_examples.sh
26+

test_examples.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cd examples
2+
for chip in * ; do
3+
cd $chip
4+
for example in * ; do
5+
cd $example
6+
echo "Testing $example for $chip"
7+
if [[ $chip == "atmega328p" ]];
8+
then
9+
AVR_CPU_FREQUENCY_HZ=16000000 cargo +nightly-2021-01-07 build -Z build-std=core --release --target ../../../avr-chips/avr-atmega328p.json >> /dev/null || exit 1
10+
else
11+
AVR_CPU_FREQUENCY_HZ=16000000 cargo +nightly-2021-01-07 build -Z build-std=core --release --target ../../../avr-chips/avr-atmega2560.json >> /dev/null || exit 1
12+
fi
13+
cd ..
14+
done
15+
cd ..
16+
done

toolchain.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
rustup toolchain install nightly-2021-01-07
22
rustup override set nightly-2021-01-07
3-
rustup +nightly-2021-01-07 component add rust-src
3+
rustup +nightly-2021-01-07 component add rustfmt-preview
4+
rustup +nightly-2021-01-07 component add rust-src

0 commit comments

Comments
 (0)