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

Update CI #710

Merged
merged 6 commits into from
Nov 25, 2022
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
85 changes: 27 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
branches: [main, staging, trying]
pull_request:
branches: [main]
# don't run CI when changing md-files, except they are part of the book
paths-ignore:
- "*.md"
- "!book/src/**"
schedule:
# runs 1 min after 2 or 1 AM (summer/winter) berlin time
- cron: "1 0 * * *"
Expand All @@ -22,22 +18,16 @@ jobs:
host:
strategy:
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Install C libraries for tooling on ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
Expand All @@ -47,39 +37,30 @@ jobs:
cross:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ env.NO_STD_TARGET }}
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Install NO_STD_TARGET
run: rustup target add ${{ env.NO_STD_TARGET }}
- name: Install Rust targets, build defmt crates for no_std targets, build defmt dependent crates for cortex-m targets, build panic-probe with different features
run: cargo xtask test-cross

lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Run rustfmt & clippy
run: cargo xtask test-lint

ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Install Rust stable, run all UI tests on the host
run: cargo xtask test-ui

Expand All @@ -93,12 +74,9 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
Expand All @@ -107,20 +85,13 @@ jobs:
run: cargo xtask test-book

qemu-snapshot:
strategy:
matrix:
rust:
- stable
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
target: ${{ env.QEMU_TARGET }}
- uses: actions/checkout@v3
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Install QEMU_TARGET
run: rustup target add ${{ env.QEMU_TARGET }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install qemu qemu-system-arm
- name: Run QEMU snapshot tests
Expand All @@ -129,15 +100,13 @@ jobs:
backcompat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ env.QEMU_TARGET }}
- name: Use the latest stable release
run: rustup update stable && rustup default stable
- name: Install QEMU_TARGET
run: rustup target add ${{ env.QEMU_TARGET }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install qemu qemu-system-arm
- name: Run backward compatibility test
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- [#710]: Update CI
- [#704]: Release `defmt-macros 0.3.3`, `defmt-print 0.3.3`, `defmt-rtt 0.4.0`
- [#703]: `defmt-print`: Update to `clap 4.0`.
- [#701]: Pre-relase cleanup
Expand All @@ -24,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [#679]: `CI`: Add changelog enforcer
- [#678]: Satisfy clippy

[#710]: https://github.com/knurling-rs/defmt/pull/710
[#704]: https://github.com/knurling-rs/defmt/pull/704
[#703]: https://github.com/knurling-rs/defmt/pull/703
[#701]: https://github.com/knurling-rs/defmt/pull/701
Expand Down
7 changes: 4 additions & 3 deletions decoder/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ impl<'t> Frame<'t> {
TimePrecision::Seconds => chrono::SecondsFormat::Secs,
};
let date_time = match precision {
TimePrecision::Millis => chrono::Utc.timestamp_millis(timestamp as i64),
TimePrecision::Seconds => chrono::Utc.timestamp(timestamp as i64, 0),
};
TimePrecision::Millis => chrono::Utc.timestamp_millis_opt(timestamp as i64),
TimePrecision::Seconds => chrono::Utc.timestamp_opt(timestamp as i64, 0),
}
.unwrap();
write!(buf, "{}", date_time.to_rfc3339_opts(format, true))
}
}
Expand Down