Skip to content

Add check ci for single crates. #35

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

Merged
merged 1 commit into from
Aug 6, 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
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,72 @@ jobs:
toolchain: nightly
command: doc
args: --workspace --no-deps --all-features

check:
name: Check
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php-version:
- "7.4"
features:
- ""
- "--all-features"

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install libclang
run: sudo apt-get install -y llvm-10-dev libclang-10-dev

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: php-config

- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Cargo check phper-sys
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-sys/Cargo.toml ${{ matrix.features }}

- name: Cargo check phper-build
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-build/Cargo.toml ${{ matrix.features }}

- name: Cargo check phper-macros
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-macros/Cargo.toml ${{ matrix.features }}

- name: Cargo check phper-alloc
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-alloc/Cargo.toml ${{ matrix.features }}

- name: Cargo check phper-test
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-test/Cargo.toml ${{ matrix.features }}

- name: Cargo check phper
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper/Cargo.toml ${{ matrix.features }}
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
with:
command: publish
args: --manifest-path phper-sys/Cargo.toml
continue-on-error: true

- name: Delay
run: sleep 20
Expand All @@ -66,6 +67,7 @@ jobs:
with:
command: publish
args: --manifest-path phper-build/Cargo.toml
continue-on-error: true

- name: Delay
run: sleep 20
Expand All @@ -75,6 +77,7 @@ jobs:
with:
command: publish
args: --manifest-path phper-macros/Cargo.toml
continue-on-error: true

- name: Delay
run: sleep 20
Expand All @@ -84,6 +87,7 @@ jobs:
with:
command: publish
args: --manifest-path phper-alloc/Cargo.toml
continue-on-error: true

- name: Delay
run: sleep 20
Expand All @@ -93,6 +97,7 @@ jobs:
with:
command: publish
args: --manifest-path phper-test/Cargo.toml
continue-on-error: true

- name: Delay
run: sleep 20
Expand Down
12 changes: 6 additions & 6 deletions phper-test/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
// See the Mulan PSL v2 for more details.

use std::{
convert::TryInto,
ffi::{OsStr, OsString},
fmt::Debug,
path::{Path, PathBuf},
process::{Child, Command, Stdio},
thread,
time::Duration,
process::Command,
};

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

#[cfg(feature = "fpm")]
pub(crate) fn spawn_command<S: AsRef<OsStr> + Debug>(
argv: &[S], wait_time: Option<Duration>,
) -> Child {
argv: &[S], wait_time: Option<std::time::Duration>,
) -> std::process::Child {
use std::{process::Stdio, thread};

let mut command = Command::new(&argv[0]);
let child = command
.args(&argv[1..])
Expand Down