mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
ci: add github workflows (#3)
Add CI workflows for docs, compile, test, and audit. Dependabot also included.
This commit is contained in:
parent
8dc94d6cc4
commit
c523748c3e
3 changed files with 110 additions and 0 deletions
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: cargo
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "13:00"
|
||||
open-pull-requests-limit: 10
|
68
.github/workflows/build.yml
vendored
Normal file
68
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
on: [push, pull_request]
|
||||
|
||||
name: build
|
||||
|
||||
jobs:
|
||||
pingora:
|
||||
strategy:
|
||||
matrix:
|
||||
# TODO: add nightly
|
||||
toolchain: [stable]
|
||||
profile: [minimal, default]
|
||||
runs-on: ubuntu-latest
|
||||
# Only run on "pull_request" event for external PRs. This is to avoid
|
||||
# duplicate builds for PRs created from internal branches.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y cmake libclang-dev wget gnupg ca-certificates lsb-release --no-install-recommends
|
||||
# openresty is used for convenience in tests as a server.
|
||||
wget -O - https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install -y openresty --no-install-recommends
|
||||
|
||||
- name: Install toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
profile: ${{ matrix.profile }}
|
||||
components: rustfmt, clippy
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: Run cargo fmt
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: -- --check
|
||||
|
||||
- name: Run cargo test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --verbose --lib --bins --tests --no-fail-fast
|
||||
|
||||
# Need to run doc tests separately.
|
||||
# (https://github.com/rust-lang/cargo/issues/6669)
|
||||
- name: Run cargo doc test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --verbose --doc
|
||||
|
||||
- name: Run cargo clippy
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-targets --all -- --deny=warnings
|
||||
|
||||
- name: Run cargo audit
|
||||
uses: actions-rust-lang/audit@v1
|
34
.github/workflows/docs.yml
vendored
Normal file
34
.github/workflows/docs.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
name: Docs
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y cmake libclang-dev
|
||||
|
||||
- name: Install stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: Run cargo doc
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: doc
|
||||
args: --no-deps --all-features
|
Loading…
Reference in a new issue