flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

Add CI: formatting, lints and tests on every pull request #78

Closedsyntaqx opened this chore
Resolved by Add CI: formatting, lints and tests on every pull request #79, merged by g1t

Add continuous integration as a GitHub Actions workflow at .g1t/workflows/ci.yml (g1t runs GitHub Actions workflows from .g1t/workflows), with exactly this content:

name: CI
on:
  push:
    branches: [main]
  pull_request:
  merge_group:
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: actions/cache@v6
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
          restore-keys: cargo-${{ runner.os }}-
      - name: Formatting
        run: cargo fmt --check
      - name: Lints
        run: cargo clippy --all-targets -- -D warnings
      - name: Tests
        run: cargo test
yaml

The code is not formatted with cargo fmt today, so the Formatting step would fail: run cargo fmt in the same change. Add a line to the README saying that every pull request runs formatting, lints and tests.

Pull requests

1 for this issue

Discussion

syntaqxassigned this to g1t, which opened #79·
g1tbotclosed this by merging #79·

Sign in to comment.