Skip to content

Commit 5ef9339

Browse files
authored
Merge pull request #424 from quartiq/feature/ci-updates
Updating CI checks
2 parents 1f1321c + 806abfd commit 5ef9339

File tree

2 files changed

+26
-56
lines changed

2 files changed

+26
-56
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,72 +17,42 @@ jobs:
1717
style:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
toolchain: stable
24-
target: thumbv7em-none-eabihf
25-
override: true
26-
- uses: Swatinem/rust-cache@v1
27-
- name: cargo fmt --check
28-
uses: actions-rs/cargo@v1
29-
with:
30-
command: fmt
31-
args: --all -- --check
32-
- uses: actions-rs/clippy-check@v1
20+
- uses: actions/checkout@v4
21+
- uses: Swatinem/rust-cache@v2
22+
23+
- uses: dtolnay/rust-toolchain@stable
3324
with:
34-
token: ${{ secrets.GITHUB_TOKEN }}
25+
targets: thumbv7em-none-eabihf
26+
components: rustfmt, clippy
27+
28+
- run: cargo fmt --all -- --check
29+
- run: cargo check
30+
31+
- run: cargo clippy --all-features -- -D warnings
3532

3633
compile:
3734
runs-on: ubuntu-latest
38-
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
39-
strategy:
40-
max-parallel: 2
41-
matrix:
42-
toolchain:
43-
- stable
4435
steps:
4536
- uses: actions/checkout@v2
4637

47-
- name: Install Rust ${{ matrix.toolchain }}
48-
uses: actions-rs/toolchain@v1
38+
- uses: dtolnay/rust-toolchain@stable
4939
with:
50-
toolchain: ${{ matrix.toolchain }}
51-
target: thumbv7em-none-eabihf
52-
override: true
40+
targets: thumbv7em-none-eabihf
5341
components: llvm-tools-preview
5442

55-
- uses: Swatinem/rust-cache@v1
56-
if: ${{ matrix.toolchain != 'nightly' }}
57-
58-
- name: Install Binutils
59-
uses: actions-rs/cargo@v1
60-
with:
61-
command: install
62-
args: cargo-binutils
43+
- uses: Swatinem/rust-cache@v2
6344

64-
- name: Build [Debug]
65-
uses: actions-rs/cargo@v1
66-
with:
67-
command: build
45+
- run: cargo install cargo-binutils
6846

69-
- name: Build [Release]
70-
uses: actions-rs/cargo@v1
71-
with:
72-
command: build
73-
args: --release
47+
- run: cargo build
48+
- run: cargo build --release
7449

7550
- name: Extract Binary
76-
uses: actions-rs/cargo@v1
77-
with:
78-
command: objcopy
79-
args: --release --verbose -- -O binary booster-release.bin
51+
run: cargo objcopy --release --verbose -- -O binary booster-release.bin
8052

8153
- name: Upload Artifacts
82-
uses: actions/upload-artifact@v2
83-
if: ${{ matrix.toolchain == 'stable'
84-
&& (github.ref == 'refs/heads/master'
85-
|| github.ref == 'refs/heads/develop') }}
54+
uses: actions/upload-artifact@v4
55+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
8656
with:
8757
name: Firmware Images
8858
path: |

src/hardware/rf_channel.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ impl Devices {
155155
) -> Option<(Self, Microchip24AA02E48<I2cProxy>)> {
156156
// The ADS7924 and DAC7571 are present on the booster mainboard, so instantiation
157157
// and communication should never fail.
158-
let mut dac7571 = Dac7571::default(i2c::AtomicDevice::new(&manager));
158+
let mut dac7571 = Dac7571::default(i2c::AtomicDevice::new(manager));
159159

160160
// Ensure the bias DAC is placing the RF amplifier in pinch off (disabled).
161161
dac7571
162162
.set_voltage(platform::BIAS_DAC_VCC)
163163
.expect("Bias DAC did not respond");
164164

165165
// Verify we can communicate with the power monitor.
166-
let mut ads7924 = Ads7924::default(i2c::AtomicDevice::new(&manager), delay)
166+
let mut ads7924 = Ads7924::default(i2c::AtomicDevice::new(manager), delay)
167167
.expect("Power monitor did not enumerate");
168168
ads7924
169169
.get_voltage(ads7924::Channel::Three)
@@ -176,11 +176,11 @@ impl Devices {
176176
assert!(ads7924.clear_alarm().expect("Failed to clear alarm") == 0);
177177

178178
// Query devices on the RF module to verify they are present.
179-
let ad5627 = Ad5627::default(i2c::AtomicDevice::new(&manager)).ok()?;
180-
let eui48 = Microchip24AA02E48::new(i2c::AtomicDevice::new(&manager)).ok()?;
181-
let mut max6642 = Max6642::att94(i2c::AtomicDevice::new(&manager));
179+
let ad5627 = Ad5627::default(i2c::AtomicDevice::new(manager)).ok()?;
180+
let eui48 = Microchip24AA02E48::new(i2c::AtomicDevice::new(manager)).ok()?;
181+
let mut max6642 = Max6642::att94(i2c::AtomicDevice::new(manager));
182182
max6642.get_remote_temperature().ok()?;
183-
let mut mcp3221 = Mcp3221::default(i2c::AtomicDevice::new(&manager));
183+
let mut mcp3221 = Mcp3221::default(i2c::AtomicDevice::new(manager));
184184
mcp3221.get_voltage().ok()?;
185185

186186
Some((

0 commit comments

Comments
 (0)