fix(.github): default dir configuration from release workflow #504
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: CI | |
on: | |
- pull_request | |
permissions: | |
contents: read # To checkout code | |
jobs: | |
# TODO: Remove later | |
build_multi: | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- os: ubuntu-20.04 | |
rust_target: x86_64-unknown-linux-gnu | |
ext: "" | |
args: "" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cargo build --package commitlint-rs --release | |
- run: ls -al . | |
- run: ls -al target | |
- run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: commitlint-${{ matrix.config.rust_target }} | |
path: commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz | |
if-no-files-found: error | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
e2e: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
tag: [cli, default] | |
steps: | |
- uses: actions/checkout@v4 | |
- 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') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- run: | | |
sudo chmod +x target/release/commitlint | |
sudo mv target/release/commitlint /usr/local/bin/commitlint | |
- uses: mig4/setup-bats@v1 | |
with: | |
bats-version: 1.9.0 | |
- run: bats cli/e2e --filter-tags ${{ matrix.tag }} | |
schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cargo run --package schema -- --path schema.json | |
# TODO: Remove later | |
- run: ls -al | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: schema.json | |
path: schema.json | |
if-no-files-found: error | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- 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') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test |