Skip to content

Commit ec365cc

Browse files
Add a gh-action and buildomat job to cargo check on no-default-features.
1 parent b9d1661 commit ec365cc

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# CI scripts:
99
# - .github/buildomat/build-and-test.sh
1010
# - .github/buildomat/jobs/clippy.sh
11+
# - .github/buildomat/jobs/check-features.sh
1112
# - .github/workflows/rust.yml
1213
#
1314
[build]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
#:
3+
#: name = "check-features (helios)"
4+
#: variety = "basic"
5+
#: target = "helios-2.0"
6+
#: rust_toolchain = true
7+
#: output_rules = []
8+
9+
# Run cargo check on illumos with feature-specifics like `no-default-features`.
10+
11+
set -o errexit
12+
set -o pipefail
13+
set -o xtrace
14+
15+
cargo --version
16+
rustc --version
17+
18+
#
19+
# Set up our PATH for use with this workspace.
20+
#
21+
source ./env.sh
22+
23+
banner prerequisites
24+
ptime -m bash ./tools/install_builder_prerequisites.sh -y
25+
26+
banner check
27+
export CARGO_INCREMENTAL=0
28+
ptime -m cargo check --workspace --bins --tests --no-default-features
29+
RUSTDOCFLAGS="--document-private-items -D warnings" ptime -m cargo doc --workspace --no-deps --no-default-features

.github/buildomat/jobs/clippy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# (that we want to check) is conditionally-compiled on illumos only.
1111
#
1212
# Note that `cargo clippy` includes `cargo check, so this ends up checking all
13-
# of our code.
13+
# of our (default) code.
1414

1515
set -o errexit
1616
set -o pipefail

.github/workflows/rust.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: cargo run --bin omicron-package -- -t default check
5454

5555
# Note that `cargo clippy` includes `cargo check, so this ends up checking all
56-
# of our code.
56+
# of our (default) code.
5757
clippy-lint:
5858
runs-on: ubuntu-22.04
5959
env:
@@ -82,6 +82,32 @@ jobs:
8282
- name: Run Clippy Lints
8383
run: cargo xtask clippy
8484

85+
check-features:
86+
runs-on: ubuntu-22.04
87+
env:
88+
CARGO_INCREMENTAL: 0
89+
steps:
90+
# This repo is unstable and unnecessary: https://github.com/microsoft/linux-package-repositories/issues/34
91+
- name: Disable packages.microsoft.com repo
92+
run: sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
93+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
94+
with:
95+
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
96+
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
97+
if: ${{ github.ref != 'refs/heads/main' }}
98+
- name: Report cargo version
99+
run: cargo --version
100+
- name: Update PATH
101+
run: source "./env.sh"; echo "PATH=$PATH" >> "$GITHUB_ENV"
102+
- name: Print PATH
103+
run: echo $PATH
104+
- name: Print GITHUB_ENV
105+
run: cat "$GITHUB_ENV"
106+
- name: Install Pre-Requisites
107+
run: ./tools/install_builder_prerequisites.sh -y
108+
- name: Run Cargo Check (No Default Features)
109+
run: cargo check --workspace --bins --tests --no-default-features
110+
85111
# This is just a test build of docs. Publicly available docs are built via
86112
# the separate "rustdocs" repo.
87113
build-docs:

0 commit comments

Comments
 (0)