Skip to content

ci(release): Removed unused steps from CI #510

ci(release): Removed unused steps from CI

ci(release): Removed unused steps from CI #510

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, edited, reopened]
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
- uses: Swatinem/rust-cache@v2
- 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
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Running linting
run: make lint
test:
name: Cargo Tests
runs-on: ubuntu-latest
env:
NATS_URL: nats://127.0.0.1:4222
NATS_ADMIN_PASS: secret
NATS_PUBLIC_PASS: secret
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: ./.github/actions/setup-rust
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Create .env file for NATS
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: Start Nats
run: |
make start/nats
- name: Run tests
run: |
make test
- name: Stop NATS
if: always()
run: make stop/nats