Tembo CLI help messages #241
Workflow file for this run
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: Cargo lint and test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
find_directories: | |
name: Find changed Cargo projects | |
runs-on: ubuntu-20.04 | |
outputs: | |
directories: ${{ steps.find_directories.outputs.build_matrix }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Find directories with Dockerfiles that changed | |
id: find_directories | |
uses: ./.github/actions/find-changed-directories | |
with: | |
contains_the_file: Cargo.toml | |
changed_relative_to_ref: origin/${{ github.base_ref || 'not-a-branch' }} | |
ignore_dirs: ".coredb examples" | |
lint: | |
name: Run linters | |
runs-on: | |
- self-hosted | |
- dind | |
- small | |
needs: | |
- find_directories | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.find_directories.outputs.directories) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
set -xe | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Install minimal nightly with clippy and rustfmt | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly-2023-11-18 | |
components: rustfmt, clippy | |
- name: Install minimal stable with clippy and rustfmt | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "${{ matrix.name }}-lint" | |
workspaces: | | |
${{ matrix.path }} | |
- name: Cargo format and clippy | |
run: | | |
set -xe | |
cd ${{ matrix.path }} | |
cargo +nightly-2023-11-18 --version | |
cargo +nightly-2023-11-18 fmt --all --check | |
cargo +nightly-2023-11-18 clippy | |
test: | |
name: Run tests | |
runs-on: | |
- self-hosted | |
- dind | |
- large-8x8 | |
needs: | |
- find_directories | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.find_directories.outputs.directories) }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Install system dependencies | |
run: | | |
set -xe | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "${{ matrix.name }}-test" | |
workspaces: | | |
${{ matrix.path }} | |
- name: Unit tests | |
run: | | |
set -xe | |
export PROMETHEUS_URL=https://prometheus-data-1.use1.dev.plat.cdb-svc.com | |
cd ${{ matrix.path }} && cargo test |