Add initial SQL support #80
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
# Copyright 2023 The SeamDB Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- 'ci/**' | |
pull_request: | |
env: | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: full | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
license: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check license header | |
run: docker run --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye-native:v3 check | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt install -y protobuf-compiler libprotobuf-dev | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: Install rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build code | |
run: cargo build | |
test: | |
needs: [build] | |
runs-on: ubuntu-latest | |
env: | |
RUST_LOG: trace | |
steps: | |
- run: sudo apt install -y protobuf-compiler libprotobuf-dev | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: Install rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Test code | |
run: cargo test -- --nocapture | |
lint: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt install -y protobuf-compiler libprotobuf-dev | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: Install rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: clippy | |
- name: Lint code | |
run: cargo clippy --no-deps -- -D clippy::all | |
release: | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
needs: [license, build, test, lint] | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt install -y protobuf-compiler libprotobuf-dev | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: publish crate | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish |