📝 Add LICENSE #16
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
name: Pre-release Checks | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: ⚡ Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-pgrx | |
run: | | |
cargo pgrx --help 2>/dev/null 1>&2 || cargo install cargo-pgrx | |
- name: ⚡ Cache pgrx | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pgrx/ | |
key: ${{ runner.os }}-pgrx | |
- name: Initialize pgrx | |
run: | | |
if [ ! -f ~/.pgrx/config.toml ]; then | |
cargo pgrx init | |
fi | |
- name: Run cargo check | |
run: cargo check | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y && sudo apt-get install -y libbtrfsutil-dev | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: ⚡ Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-pgrx | |
run: | | |
cargo pgrx --help 2>/dev/null 1>&2 || cargo install cargo-pgrx | |
- name: ⚡ Cache pgrx | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pgrx/ | |
key: ${{ runner.os }}-pgrx | |
- name: Initialize pgrx | |
run: | | |
if [ ! -f ~/.pgrx/config.toml ]; then | |
cargo pgrx init | |
fi | |
- name: Run cargo test | |
run: cargo test | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: ⚡ Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Install cargo-pgrx | |
run: | | |
cargo pgrx --help 2>/dev/null 1>&2 || cargo install cargo-pgrx | |
- name: ⚡ Cache pgrx | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pgrx/ | |
key: ${{ runner.os }}-pgrx | |
- name: Initialize pgrx | |
run: | | |
if [ ! -f ~/.pgrx/config.toml ]; then | |
cargo pgrx init | |
fi | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings |