diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml new file mode 100644 index 0000000..d3647d5 --- /dev/null +++ b/.github/workflows/on-push.yml @@ -0,0 +1,31 @@ +name: Continuous Integration +on: [push, pull_request, merge_group] + +env: + RUSTFLAGS: "-Dwarnings" + RUSTDOCFLAGS: "-Dwarnings" + +jobs: + lint: + name: Lint and format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.80.0 + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --workspace --all-targets --all-features --no-deps + - run: cargo doc --workspace --no-deps + - run: cargo fmt --check --all + + test: + name: Test + needs: 'lint' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.80.0 + - uses: Swatinem/rust-cache@v2 + - run: cargo test --workspace --no-run + - run: cargo test --workspace --no-fail-fast diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e69cbbe..d6dc107 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,5 +14,3 @@ repos: rev: v1.1.0 hooks: - id: fmt - - id: check - - id: clippy diff --git a/README.md b/README.md index 0345a59..f2dee91 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,17 @@ # Typstd +![Linting and testing][1] + +[1]: https://github.com/daskol/typstd/actions/workflows/on-push.yml/badge.svg + ## Overview -**Typstd** is a pretty simple language server for [Typst][1] markup language. +**Typstd** is a pretty simple language server for [Typst][2] markup language. Its distinctive feature is workspace management and completion for global objects which are defined out of scope of text document in focus (e.g. bibliography references). -[1]: https://github.com/typst/typst +[2]: https://github.com/typst/typst ### Workspace