Skip to content

Publish crate docs to GitHub Pages #156

Publish crate docs to GitHub Pages

Publish crate docs to GitHub Pages #156

Workflow file for this run

name: Rust
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
jobs:
test-linux:
name: Test (Linux)
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v3
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/nginx
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: run tests
run: cargo test --verbose
examples-linux:
name: Examples (Linux)
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v3
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/nginx
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: compile examples
run: cargo build --release --package examples --examples --verbose
test-macos:
name: Test (MacOS)
runs-on: macos-latest
steps:
- name: install command line dependencies
run: brew install make gnupg
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: current directory
run: pwd
- name: make cache directory
run: mkdir -p .cache/.gnupg
- name: disable ipv6 for gpg
run: echo "disable-ipv6" > .cache/.gnupg/dirmngr.conf
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: rustfmt version
run: rustfmt --version
- name: cargo fmt
run: cargo fmt --all --verbose --check || true
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps source cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/nginx
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: run clippy
run: cargo clippy -- -D warnings