Skip to content

Commit 3069548

Browse files
authored
Add check ci for single crates. (#35)
1 parent 8f95f3e commit 3069548

File tree

3 files changed

+80
-6
lines changed

3 files changed

+80
-6
lines changed

.github/workflows/ci.yml

+69
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,72 @@ jobs:
116116
toolchain: nightly
117117
command: doc
118118
args: --workspace --no-deps --all-features
119+
120+
check:
121+
name: Check
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
os:
126+
- ubuntu-latest
127+
php-version:
128+
- "7.4"
129+
features:
130+
- ""
131+
- "--all-features"
132+
133+
runs-on: ${{ matrix.os }}
134+
steps:
135+
- name: Checkout
136+
uses: actions/checkout@v2
137+
138+
- name: Install libclang
139+
run: sudo apt-get install -y llvm-10-dev libclang-10-dev
140+
141+
- name: Setup PHP
142+
uses: shivammathur/setup-php@v2
143+
with:
144+
php-version: ${{ matrix.php-version }}
145+
tools: php-config
146+
147+
- name: Install Rust Stable
148+
uses: actions-rs/toolchain@v1
149+
with:
150+
toolchain: stable
151+
override: true
152+
153+
- name: Cargo check phper-sys
154+
uses: actions-rs/cargo@v1
155+
with:
156+
command: check
157+
args: --manifest-path phper-sys/Cargo.toml ${{ matrix.features }}
158+
159+
- name: Cargo check phper-build
160+
uses: actions-rs/cargo@v1
161+
with:
162+
command: check
163+
args: --manifest-path phper-build/Cargo.toml ${{ matrix.features }}
164+
165+
- name: Cargo check phper-macros
166+
uses: actions-rs/cargo@v1
167+
with:
168+
command: check
169+
args: --manifest-path phper-macros/Cargo.toml ${{ matrix.features }}
170+
171+
- name: Cargo check phper-alloc
172+
uses: actions-rs/cargo@v1
173+
with:
174+
command: check
175+
args: --manifest-path phper-alloc/Cargo.toml ${{ matrix.features }}
176+
177+
- name: Cargo check phper-test
178+
uses: actions-rs/cargo@v1
179+
with:
180+
command: check
181+
args: --manifest-path phper-test/Cargo.toml ${{ matrix.features }}
182+
183+
- name: Cargo check phper
184+
uses: actions-rs/cargo@v1
185+
with:
186+
command: check
187+
args: --manifest-path phper/Cargo.toml ${{ matrix.features }}

.github/workflows/publish.yml

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
command: publish
5959
args: --manifest-path phper-sys/Cargo.toml
60+
continue-on-error: true
6061

6162
- name: Delay
6263
run: sleep 20
@@ -66,6 +67,7 @@ jobs:
6667
with:
6768
command: publish
6869
args: --manifest-path phper-build/Cargo.toml
70+
continue-on-error: true
6971

7072
- name: Delay
7173
run: sleep 20
@@ -75,6 +77,7 @@ jobs:
7577
with:
7678
command: publish
7779
args: --manifest-path phper-macros/Cargo.toml
80+
continue-on-error: true
7881

7982
- name: Delay
8083
run: sleep 20
@@ -84,6 +87,7 @@ jobs:
8487
with:
8588
command: publish
8689
args: --manifest-path phper-alloc/Cargo.toml
90+
continue-on-error: true
8791

8892
- name: Delay
8993
run: sleep 20
@@ -93,6 +97,7 @@ jobs:
9397
with:
9498
command: publish
9599
args: --manifest-path phper-test/Cargo.toml
100+
continue-on-error: true
96101

97102
- name: Delay
98103
run: sleep 20

phper-test/src/utils.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
// See the Mulan PSL v2 for more details.
1010

1111
use std::{
12-
convert::TryInto,
1312
ffi::{OsStr, OsString},
1413
fmt::Debug,
1514
path::{Path, PathBuf},
16-
process::{Child, Command, Stdio},
17-
thread,
18-
time::Duration,
15+
process::Command,
1916
};
2017

2118
pub(crate) fn execute_command<S: AsRef<OsStr> + Debug>(argv: &[S]) -> String {
@@ -28,9 +25,12 @@ pub(crate) fn execute_command<S: AsRef<OsStr> + Debug>(argv: &[S]) -> String {
2825
String::from_utf8(output).unwrap().trim().to_owned()
2926
}
3027

28+
#[cfg(feature = "fpm")]
3129
pub(crate) fn spawn_command<S: AsRef<OsStr> + Debug>(
32-
argv: &[S], wait_time: Option<Duration>,
33-
) -> Child {
30+
argv: &[S], wait_time: Option<std::time::Duration>,
31+
) -> std::process::Child {
32+
use std::{process::Stdio, thread};
33+
3434
let mut command = Command::new(&argv[0]);
3535
let child = command
3636
.args(&argv[1..])

0 commit comments

Comments
 (0)