diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8da840..72c7414 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -on: +on: push: branches: - main @@ -9,35 +9,30 @@ name: Continuous Integration jobs: macos: - name: Test and Lint (macos) + name: macos runs-on: macos-latest strategy: matrix: rust: - stable - - 1.67.0 + - beta + - stable minus 6 releases steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - - name: test - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-run - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + components: clippy, rustfmt + + - name: check (default features) + run: cargo check + + - name: test (default features) + run: cargo test --no-run + + - name: clippy (default features) + run: cargo clippy -- -D warnings clang-format: name: test clang-format diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..4b9120d --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,20 @@ +name: Pull request +# This workflow is triggered on pushes to the repository. +on: [ pull_request ] + +jobs: + check: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # A PR should not contain too many commits + fetch-depth: 10 + - name: Validate commit messages + run: | + git show-ref + curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco + chmod +x convco + ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} + rm convco diff --git a/.github/workflows/semver-checks.yml b/.github/workflows/semver-checks.yml new file mode 100644 index 0000000..205f0c2 --- /dev/null +++ b/.github/workflows/semver-checks.yml @@ -0,0 +1,18 @@ +name: Semver Checks +on: + push: + branches: + - main + pull_request: + +jobs: + semver: + name: cargo-semver-checks + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + + - name: check semver + uses: obi1kenobi/cargo-semver-checks-action@v2.6