Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jun 3, 2024
1 parent 83f2a84 commit a1c48db
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check Changelog

on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

permissions:
contents: read

jobs:
check-changelog:
runs-on: ubuntu-latest
if: (!contains(github.event.pull_request.labels.*.name, 'skip changelog'))
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check that CHANGELOG is touched
run: |
git fetch origin ${{ github.base_ref }} --depth 1 && \
git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
pull_request:

jobs:
check_publishable:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
# Most of the time this will be a no-op, since GitHub releases new images every week
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt.
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check cargo publish
run: cargo publish --dry-run

lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
# Most of the time this will be a no-op, since GitHub releases new images every week
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt.
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Clippy
# Using --all-targets so tests are checked and --deny to fail on warnings.
# Not using --locked here and below since Cargo.lock is in .gitignore.
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: rustfmt
run: cargo fmt -- --check
- name: Check docs
# Using RUSTDOCFLAGS until `cargo doc --check` is stabilised:
# https://github.com/rust-lang/cargo/issues/10025
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --document-private-items --no-deps

unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Run unit tests
run: cargo test --all-features

0 comments on commit a1c48db

Please sign in to comment.