Skip to content
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

feat!: set supported Rust version to 1.79.0 #98

Merged
merged 5 commits into from
Nov 22, 2024
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
37 changes: 31 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,29 @@ env:
RUSTDOCFLAGS: '-Dwarnings'

jobs:
rust-version:
name: Minimal supported Rust version
outputs:
version: ${{ steps.read_version.outputs.msrv }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: read_version
run: |
awk -F '=' \
'/^rust-version[[:space:]]*=/ { gsub(/([" ]|#.*)/,"",$2); print ("msrv=" $2) }' \
Cargo.toml \
| tee -a "$GITHUB_OUTPUT"

test-linux:
name: Test (Linux)
needs: rust-version
runs-on: ubuntu-latest
strategy:
matrix:
rust-version:
- ${{ needs.rust-version.outputs.version }}
- stable
steps:
- name: checkout source
uses: actions/checkout@v4
Expand All @@ -24,8 +44,8 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
key: ${{ runner.os }}-cargo-${{ matrix.rust-version}}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-
- name: set up nginx deps cache
uses: actions/cache@v4
continue-on-error: false
Expand All @@ -38,24 +58,29 @@ jobs:
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- uses: dtolnay/rust-toolchain@stable

- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt, clippy
toolchain: ${{ matrix.rust-version }}

- name: build
id: build
run: cargo build --workspace --all-targets --all-features

- name: run clippy
if: ${{ !cancelled() && steps.build.outcome == 'success' }} # always run if build succeeds
# always run if build succeeds
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings

- name: run tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }} # always run if build succeeds
# always run if build succeeds
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: cargo test --workspace --all-features

- name: rustdoc
if: ${{ !cancelled() && steps.build.outcome == 'success' }} # always run if build succeeds
# always run if build succeeds
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: cargo doc --no-deps

examples-linux:
Expand Down
18 changes: 12 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@ members = [
"examples",
]

[workspace.package]
edition = "2021"
license = "Apache-2.0"
homepage = "https://github.com/nginxinc/ngx-rust"
repository = "https://github.com/nginxinc/ngx-rust"
rust-version = "1.79.0"

[package]
name = "ngx"
version = "0.5.0"
edition = "2021"
autoexamples = false
categories = ["api-bindings", "network-programming"]
description = "FFI bindings to NGINX"
repository = "https://github.com/nginxinc/ngx-rust"
homepage = "https://github.com/nginxinc/ngx-rust"
license = "Apache-2.0"
keywords = ["nginx", "module", "sys"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
nginx-sys = { path = "nginx-sys", version = "0.5.0"}
Expand Down
7 changes: 5 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
name = "examples"
version = "0.0.0"
publish = false
edition = "2021"
license = "Apache-2.0"
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dev-dependencies]
ngx = { path = "../", default-features = false }
Expand Down
12 changes: 5 additions & 7 deletions nginx-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
[package]
name = "nginx-sys"
version = "0.5.0"
edition = "2021"
categories = ["external-ffi-bindings"]
description = "FFI bindings to NGINX"
repository = "https://github.com/nginxinc/ngx-rust"
homepage = "https://github.com/nginxinc/ngx-rust"
license = "Apache-2.0"
keywords = ["nginx", "ffi", "sys"]
build = "build/main.rs"

[lib]
crate-type = ["staticlib", "rlib"]
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]

Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# group_imports = "StdExternalCrate" # unstable
edition = "2021"
max_width = 120
Loading