Skip to content

Commit

Permalink
Tweak CI setup and fix Windows #![no_std] (#37)
Browse files Browse the repository at this point in the history
- Add cron job every week (to catch compiler updates)
- Replace beta with nightly
- Add `--no-default-features` for `#![no_std]` support
- Fix `#![no_std]` support for Windows
  • Loading branch information
lambda-fairy authored Oct 27, 2021
1 parent 2a08434 commit 876f82b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '5 21 * * 5'
workflow_dispatch:

name: CI

Expand All @@ -9,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [beta, stable, 1.13.0]
rust: [stable, nightly, 1.13.0]
exclude:
# https://github.com/rust-lang/rust/issues/34674
- os: macos-latest
Expand All @@ -24,6 +31,11 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --lib
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

wasi:
name: Test WASI
Expand Down
5 changes: 5 additions & 0 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(feature = "std")]
use std::ptr;
use winapi::shared::minwindef::DWORD;
#[cfg(feature = "std")]
use winapi::shared::ntdef::WCHAR;
#[cfg(feature = "std")]
use winapi::um::winbase::{FORMAT_MESSAGE_FROM_SYSTEM, FORMAT_MESSAGE_IGNORE_INSERTS};

use Errno;

#[cfg(feature = "std")]
pub fn with_description<F, T>(err: Errno, callback: F) -> T where
F: FnOnce(Result<&str, Errno>) -> T
{
Expand Down Expand Up @@ -50,6 +54,7 @@ pub fn with_description<F, T>(err: Errno, callback: F) -> T where
}
}

#[cfg(feature = "std")]
pub const STRERROR_NAME: &'static str = "FormatMessageW";

pub fn errno() -> Errno {
Expand Down

0 comments on commit 876f82b

Please sign in to comment.