refactor(data-parser): Make data-parser nats agnostic and more extensibe for benches #572
Workflow file for this run
This file contains hidden or 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: | |
types: [opened, synchronize, edited, reopened] | |
push: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
CLICOLOR: 1 | |
RUST_VERSION: 1.79.0 | |
RUST_NIGHTLY_VERSION: "nightly-2024-07-28" | |
CI: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
validate-title: | |
name: Validate PR Title | |
runs-on: ubuntu-latest | |
steps: | |
- uses: amannn/action-semantic-pull-request@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
requireScope: true | |
subjectPattern: ^([A-Z]).+$ | |
types: | | |
build | |
ci | |
docs | |
feat | |
fix | |
perf | |
refactor | |
test | |
scopes: | | |
benches | |
repo | |
deps | |
release | |
core | |
publisher | |
data-parser | |
fuel-streams | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-rust | |
with: | |
toolchain: ${{ env.RUST_NIGHTLY_VERSION }} | |
target: x86_64-unknown-linux-gnu | |
- uses: actions/setup-python@v3 | |
- uses: pre-commit/action@v3.0.1 | |
lockfile: | |
name: Validate Lockfile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: ./.github/actions/setup-rust | |
- run: cargo update --workspace --locked | |
commitlint: | |
name: Validating commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node && PNPM | |
uses: ./.github/actions/setup-node | |
- name: Install commitlint | |
run: | | |
npm install commitlint@latest | |
npm install @commitlint/config-conventional | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: npx commitlint --config ./.commitlintrc.yaml --last --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: | | |
npx commitlint \ | |
--config ./.commitlintrc.yaml \ | |
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \ | |
--to ${{ github.event.pull_request.head.sha }} \ | |
--verbose | |
lint: | |
name: Linting | |
if: "!startsWith(github.head_ref, 'releases/')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
toolchain: ${{ env.RUST_NIGHTLY_VERSION }} | |
target: x86_64-unknown-linux-gnu | |
- name: Running linting | |
run: make lint | |
test-coverage: | |
name: Test & Coverage | |
runs-on: ubuntu-latest | |
env: | |
NATS_URL: nats://127.0.0.1:4222 | |
NATS_ADMIN_PASS: secret | |
NATS_PUBLIC_PASS: secret | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create .env file with NATS environment variables | |
run: | | |
echo "NATS_URL=${{ env.NATS_URL }}" > .env | |
echo "NATS_ADMIN_PASS=${{ env.NATS_ADMIN_PASS }}" >> .env | |
echo "NATS_PUBLIC_PASS=${{ env.NATS_PUBLIC_PASS }}" >> .env | |
- name: Install Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
toolchain: ${{ env.RUST_NIGHTLY_VERSION }} | |
target: x86_64-unknown-linux-gnu,wasm32-unknown-unknown | |
- name: Start Nats | |
run: | | |
make start/nats | |
- name: Run tests | |
run: make test | |
- name: Install dependencies | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libclang-dev curl | |
- name: Install Tarpaulin (Pre-built Binary) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: taiki-e/cache-cargo-install-action@v2 | |
with: | |
tool: cargo-tarpaulin@0.31 | |
- name: Generate Code Coverage | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: make coverage | |
- name: Upload to codecov.io | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: codecov/codecov-action@v4 | |
with: | |
name: codecov-data-systems | |
fail_ci_if_error: true | |
verbose: true | |
files: ./cov-reports/cobertura.xml ./cov-reports/tarpaulin-report.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Stop Nats | |
if: always() | |
run: make stop/nats |