-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from nyurik/wip
Incremental changes to fix this with macros
- Loading branch information
Showing
8 changed files
with
850 additions
and
779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,41 @@ | ||
name: Build | ||
on: [push] | ||
|
||
# FIXME: remove testing_gq from below | ||
|
||
on: | ||
push: | ||
branches: [ main, testing_gq ] | ||
pull_request: | ||
branches: [ main, testing_gq ] | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
main: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # 7.6 is not yet supported properly. Once fixed, this can be set to true | ||
matrix: | ||
include: | ||
- setup: varnish74 | ||
- setup: varnish75 | ||
- setup: varnish76 | ||
env: | ||
RUST_BACKTRACE: 1 | ||
RUSTDOCFLAGS: -D warnings | ||
RUSTFLAGS: -D warnings | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- run: | | ||
sudo apt-get install -y curl | ||
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish75/script.deb.sh | sudo bash | ||
sudo apt-get install varnish-dev | ||
- run: | | ||
export RUST_BACKTRACE=1 | ||
cargo doc | ||
cargo build | ||
cargo test | ||
- uses: taiki-e/install-action@v2 | ||
with: { tool: just } | ||
- uses: actions/checkout@v4 | ||
- name: Ensure this crate has not yet been published (on release) | ||
if: github.event_name == 'release' | ||
run: just check-if-published | ||
- uses: Swatinem/rust-cache@v2 | ||
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | ||
- name: install varnish-dev | ||
run: | | ||
curl -s https://packagecloud.io/install/repositories/varnishcache/${{ matrix.setup }}/script.deb.sh | sudo bash | ||
sudo apt-get install -y varnish-dev | ||
- run: just -v ci-test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,22 @@ name = "vmod_reqwest" | |
version = "0.0.12" | ||
edition = "2021" | ||
license = "BSD-3-Clause" | ||
authors = [ "Guillaume Quintard [email protected]" ] | ||
|
||
[build-dependencies] | ||
varnish = { git = "https://github.com/gquintard/varnish-rs.git", branch = "proc-macro-cleanup-gq"} | ||
authors = ["Guillaume Quintard [email protected]"] | ||
|
||
[dependencies] | ||
varnish = { git = "https://github.com/gquintard/varnish-rs.git", branch = "proc-macro-cleanup-gq"} | ||
varnish-sys = { git = "https://github.com/gquintard/varnish-rs.git", branch = "proc-macro-cleanup-gq"} | ||
varnish-macros = { git = "https://github.com/gquintard/varnish-rs.git", branch = "proc-macro-cleanup-gq" } | ||
regex = "1.5" | ||
lru = "0.7.1" | ||
anyhow = "1.0" | ||
bytes = "1.1.0" | ||
reqwest = { version = "0.11", features = ["stream", "deflate", "gzip", "brotli", "native-tls"] } | ||
tokio = { version = "1", features = ["full"] } | ||
futures = "0.3" | ||
futures-util = "0.3" | ||
hyper = "0.14.16" | ||
anyhow = "1.0" | ||
lru = "0.7.1" | ||
regex = "1.5" | ||
reqwest = { version = "0.11", features = ["stream", "deflate", "gzip", "brotli", "native-tls"] } | ||
serde_json = "1" | ||
tokio = { version = "1", features = ["full"] } | ||
varnish = { git = "https://github.com/gquintard/varnish-rs.git", branch = "feature-macro"} | ||
varnish-macros = { git = "https://github.com/gquintard/varnish-rs.git", branch = "feature-macro" } | ||
varnish-sys = { git = "https://github.com/gquintard/varnish-rs.git", branch = "feature-macro"} | ||
|
||
[lib] | ||
crate-type = ["cdylib"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env just --justfile | ||
|
||
@_default: | ||
just --list --unsorted | ||
|
||
# Clean all build artifacts | ||
clean: | ||
cargo clean | ||
rm -f Cargo.lock | ||
|
||
# Update dependencies, including breaking changes | ||
update: | ||
cargo +nightly -Z unstable-options update --breaking | ||
cargo update | ||
|
||
# Run cargo clippy | ||
clippy: | ||
cargo clippy --workspace --all-targets -- -D warnings | ||
|
||
# Test code formatting | ||
test-fmt: | ||
cargo fmt --all -- --check | ||
|
||
# Run cargo fmt | ||
fmt: | ||
cargo +nightly fmt -- --config imports_granularity=Module,group_imports=StdExternalCrate | ||
|
||
# Build and open code documentation | ||
docs: | ||
cargo doc --no-deps --open | ||
|
||
# Quick compile | ||
check: | ||
cargo check --workspace --all-targets | ||
|
||
# Default build | ||
build: | ||
cargo build --workspace --all-targets | ||
|
||
# Run all tests | ||
test: build | ||
cargo test --workspace --all-targets | ||
|
||
# Test documentation | ||
test-doc: | ||
cargo doc --no-deps | ||
|
||
rust-info: | ||
rustc --version | ||
cargo --version | ||
|
||
# Run all tests as expected by CI | ||
ci-test: rust-info test-fmt clippy test test-doc | ||
|
||
# Verify that the current version of the crate is not the same as the one published on crates.io | ||
check-if-published: | ||
#!/usr/bin/env bash | ||
LOCAL_VERSION="$(grep '^version =' Cargo.toml | sed -E 's/version = "([^"]*)".*/\1/')" | ||
echo "Detected crate version: $LOCAL_VERSION" | ||
CRATE_NAME="$(grep '^name =' Cargo.toml | head -1 | sed -E 's/name = "(.*)"/\1/')" | ||
echo "Detected crate name: $CRATE_NAME" | ||
PUBLISHED_VERSION="$(cargo search ${CRATE_NAME} | grep "^${CRATE_NAME} =" | sed -E 's/.* = "(.*)".*/\1/')" | ||
echo "Published crate version: $PUBLISHED_VERSION" | ||
if [ "$LOCAL_VERSION" = "$PUBLISHED_VERSION" ]; then | ||
echo "ERROR: The current crate version has already been published." | ||
exit 1 | ||
else | ||
echo "The current crate version has not yet been published." | ||
fi |
Oops, something went wrong.