Add some logging when cbrs events after the cbrs disable time are dro… #876
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: CI | |
on: | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
workflow_dispatch: # Allows manual triggering | |
inputs: | |
release_version: | |
description: "Release Version (e.g., 1.0.0)" | |
required: true | |
type: string | |
env: | |
CARGO_INCREMENTAL: 0 # this setting is automatically applied by rust-cache but documented here for explicitness | |
CARGO_NET_RETRY: 10 | |
RUST_BACKTRACE: short | |
RUSTFLAGS: "-D warnings" | |
RUSTUP_MAX_RETRIES: 10 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-build | |
cancel-in-progress: true | |
steps: | |
- name: Free Up Disk Space | |
run: | | |
echo "Freeing up disk space..." | |
echo "Disk space before cleanup:" | |
df -h | |
sudo apt-get clean | |
sudo rm -rf /usr/local/lib/android /usr/lib/jvm /usr/local/share/boost /opt/hostedtoolcache | |
docker system prune -a -f | |
echo "Disk space after cleanup:" | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust install | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build --all --tests | |
fmt: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-fmt | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust install | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Check formatting | |
run: cargo fmt -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-clippy | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust install | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clippy | |
run: cargo clippy --all-targets -- -Dclippy::all -D warnings | |
tests-postgres: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
package: [boost-manager,file-store,iot-config,iot-packet-verifier,iot-verifier,mobile-config,mobile-packet-verifier,mobile-verifier] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-tests-postgres-${{ matrix.package }} | |
cancel-in-progress: true | |
services: | |
postgres: | |
image: postgres:14.9-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust install | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run unit and integration tests | |
env: | |
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" | |
run: cargo test -p ${{ matrix.package }} -- --include-ignored | |
tests: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
package: [coverage-map,coverage-point-calculator,ingest,reward-scheduler,task-manager] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-tests-${{ matrix.package }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust install | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run unit and integration tests | |
run: cargo test -p ${{ matrix.package }} -- --include-ignored | |
build-release: | |
needs: [fmt, clippy, tests, tests-postgres] | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-build-release | |
cancel-in-progress: true | |
if: > | |
(github.event_name == 'workflow_dispatch') || (contains(github.ref, 'refs/tags/')) | |
steps: | |
- name: Show Inputs | |
run: | | |
echo "Release Version: ${{ github.event.inputs.release_version }}" | |
- name: Install Dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update | |
apt-get install -y tzdata | |
ln -fs /usr/share/zoneinfo/UTC /etc/localtime | |
dpkg-reconfigure -f noninteractive tzdata | |
apt-get install -y curl build-essential pkg-config libssl-dev unzip | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
# TODO: update key when we retire 20.04 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ubuntu-20.04-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build Release | |
run: cargo build --all --release | |
- name: Debian packaging | |
env: | |
PACKAGECLOUD_API_KEY: ${{ secrets.PACKAGECLOUD_API_KEY }} | |
RELEASE_VERSION: ${{ github.event.inputs.release_version }} | |
run: | | |
chmod +x ./.github/scripts/make_debian.sh | |
./.github/scripts/make_debian.sh |