Skip to content

Commit 876826e

Browse files
committed
Merge branch 'Testing'
2 parents 5523822 + b391175 commit 876826e

File tree

5 files changed

+140
-1
lines changed

5 files changed

+140
-1
lines changed

.github/workflows/cross_compile.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
2+
# in order to compile our application for some unusual targets.
3+
4+
on: [push, pull_request]
5+
6+
name: Cross-compile
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
target:
15+
- armv7-unknown-linux-gnueabihf
16+
# - mips-unknown-linux-musl
17+
- x86_64-unknown-linux-musl
18+
- aarch64-unknown-linux-gnu
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
target: ${{ matrix.target }}
25+
override: true
26+
- uses: actions-rs/cargo@v1
27+
with:
28+
use-cross: true
29+
command: build
30+
args: --target=${{ matrix.target }} --no-default-features --features json,default-json,cbor

.github/workflows/main.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
2+
#
3+
# While our "example" application has the platform-specific code,
4+
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
5+
# For multi-OS testing see the `cross.yml` workflow.
6+
7+
on: [push, pull_request]
8+
9+
name: Quickstart
10+
11+
jobs:
12+
lints:
13+
name: Lints
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v2
18+
19+
- name: Install stable toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: stable
24+
override: true
25+
components: rustfmt
26+
# components: rustfmt, clippy
27+
28+
- name: Run cargo fmt
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: fmt
32+
args: --all -- --check
33+
34+
# TODO enable clippy when unsafe calls are fixed
35+
# - name: Run cargo clippy
36+
# run: cargo clippy -- -D warnings
37+
38+
check:
39+
name: Check
40+
runs-on: ${{matrix.os}}
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest, windows-latest, macos-latest]
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v2
47+
48+
- name: Install stable toolchain
49+
uses: actions-rs/toolchain@v1
50+
with:
51+
profile: minimal
52+
toolchain: stable
53+
override: true
54+
55+
- name: Run cargo check
56+
uses: actions-rs/cargo@v1
57+
with:
58+
command: check
59+
args: --examples
60+
61+
test:
62+
name: Test Suite
63+
runs-on: ${{matrix.os}}
64+
strategy:
65+
matrix:
66+
os: [ubuntu-latest, windows-latest, macos-latest]
67+
steps:
68+
- name: Checkout sources
69+
uses: actions/checkout@v2
70+
71+
- name: Install stable toolchain
72+
uses: actions-rs/toolchain@v1
73+
with:
74+
profile: minimal
75+
toolchain: stable
76+
override: true
77+
78+
- name: Run cargo build
79+
uses: actions-rs/cargo@v1
80+
with:
81+
command: build
82+
args: --examples
83+
84+
- name: Run cargo test
85+
uses: actions-rs/cargo@v1
86+
with:
87+
command: test

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ serde = { version = "1.0.195", features = ["derive"] }
4242
cargo-binstall = { version = "1.6.1" }
4343
cargo-nextest = { version = "0.9.67", locked = true }
4444
bacon = { version = "2.14.1", locked = true }
45+
changelog = { version = "0.3.4" }

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,9 @@ test:
4040
# Build docs locally
4141
doc:
4242
cargo doc --no-deps --all --open
43-
.PHONY: doc
43+
.PHONY: doc
44+
45+
# Generate new entry for CHANGELOG.md
46+
changelog:
47+
cargo bin changelog -o CHANGELOG.md
48+
.PHONY: changelog

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# axum-content-negotiation
22

3+
HTTP Content Negotiation middleware and extractor for Axum.
4+
5+
<a href="https://github.com/bltavares/axum-content-negotiation/actions?query=workflow%3AQuickstart+branch%3Amaster">
6+
<img src="https://img.shields.io/github/actions/workflow/status/bltavares/axum-content-negotiation/main.yml?branch=master" />
7+
</a>
8+
<a href="https://github.com/bltavares/axum-content-negotiation/actions?query=workflow%3ACross-compile+branch%3Amaster">
9+
<img src="https://img.shields.io/github/actions/workflow/status/bltavares/axum-content-negotiation/main.yml?branch=master" />
10+
</a>
11+
<a href="https://crates.io/crates/axum-content-negotiation">
12+
<img src="https://img.shields.io/crates/v/axum-content-negotiation.svg" />
13+
</a>
14+
<a href="https://docs.rs/axum-content-negotiation">
15+
<img src="https://docs.rs/axum-content-negotiation/badge.svg" />
16+
</a>
17+
<hr />
18+
319
A set of Axum Layers and Extractors that enable content negotiation using `Accept` and `Content-Type` headers.
420
It implements schemaless serialization and deserialization content negotiation. Currently supported encodings are:
521
- `application/json`

0 commit comments

Comments
 (0)