Skip to content

Remove features fpm for php-test. #123

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
May 1, 2023
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
95 changes: 0 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ jobs:
name: Required
needs:
- ci
- check
runs-on: ubuntu-20.04
steps:
- name: Check results
run: |
[[ ${{ needs.ci.result }} == 'success' ]] || exit 1;
[[ ${{ needs.check.result }} == 'success' ]] || exit 1;

ci:
name: CI
Expand Down Expand Up @@ -147,96 +145,3 @@ jobs:
toolchain: nightly
command: doc
args: --workspace --no-deps --all-features

# Test every features for single crate.
check:
name: Check
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
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 generate lockfile
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: generate-lockfile

- name: Setup cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-check-${{ matrix.php-version }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}

- 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 }}

- name: Cargo check phper-doc
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path phper-doc/Cargo.toml ${{ matrix.features }}
7 changes: 2 additions & 5 deletions phper-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ rust-version = { workspace = true }
repository = { workspace = true }
license = { workspace = true }

[features]
fpm = ["fastcgi-client", "tokio/full"]

[dependencies]
fastcgi-client = { version = "0.8.0", optional = true }
fastcgi-client = "0.8.0"
libc = "0.2.137"
once_cell = "1.16.0"
phper-macros = { version = "0.11.0", path = "../phper-macros" }
tempfile = "3.3.0"
tokio = { version = "1.22.0", optional = true }
tokio = { version = "1.22.0", features = ["full"] }

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
7 changes: 1 addition & 6 deletions phper-test/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@

use crate::utils;
use once_cell::sync::OnceCell;
#[cfg(feature = "fpm")]
use std::io::Write;
use std::{
env,
fs::read_to_string,
io::Write,
ops::{Deref, DerefMut},
path::Path,
process::Command,
};
#[cfg(feature = "fpm")]
use tempfile::NamedTempFile;

pub struct Context {
Expand Down Expand Up @@ -83,7 +81,6 @@ impl Context {
ContextCommand { cmd, args }
}

#[cfg(feature = "fpm")]
#[cfg_attr(docsrs, doc(cfg(feature = "fpm")))]
pub fn find_php_fpm(&self) -> Option<String> {
use std::ffi::OsStr;
Expand Down Expand Up @@ -113,8 +110,6 @@ impl Context {
})
}

#[cfg(feature = "fpm")]
#[cfg_attr(docsrs, doc(cfg(feature = "fpm")))]
pub fn create_tmp_fpm_conf_file(&self) -> NamedTempFile {
let mut tmp = NamedTempFile::new().unwrap();
let file = tmp.as_file_mut();
Expand Down
2 changes: 0 additions & 2 deletions phper-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@

pub mod cli;
mod context;
#[cfg(feature = "fpm")]
#[cfg_attr(docsrs, doc(cfg(feature = "fpm")))]
pub mod fpm;
pub mod utils;
1 change: 0 additions & 1 deletion phper-test/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ 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<std::time::Duration>,
) -> std::process::Child {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ indexmap = "1.9.2"
phper = { version = "0.11.0", path = "../../phper" }

[dev-dependencies]
phper-test = { version = "0.11.0", path = "../../phper-test", features = ["fpm"] }
phper-test = { version = "0.11.0", path = "../../phper-test" }