Skip to content

ci(repo): improve/fix release action #36

ci(repo): improve/fix release action

ci(repo): improve/fix release action #36

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.78.0
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
types: |
arch
build
ci
docs
feat
fix
perf
refactor
test
scopes: |
repo
release
data-stream
sdk-rust
sdk-ts
lockfile:
name: Validate Lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- 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: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --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: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
path: |
~/.rustup
~/.cargo/bin
key: ${{ runner.os }}-rust-toolchain
- name: Cache Cargo dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-deps-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
uses: taiki-e/install-action@v2
with:
tool: cargo-sort@1.0.9
- name: Running linting
run: make lint