Merge pull request #7 from zevorn/feat/configurable-main-page-keymaps #59
This file contains hidden or 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: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Check commit messages | |
| env: | |
| CI_COMMIT_BEFORE: ${{ github.event.before }} | |
| CI_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| CI_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| run: ./scripts/check-commit-messages.sh | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Rustfmt | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Test | |
| run: cargo test --all-targets --all-features | |
| coverage: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Coverage | |
| run: ./scripts/check-coverage.sh | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: target/coverage/lcov.info | |
| disable_search: true | |
| fail_ci_if_error: true | |
| - name: Upload coverage artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| target/coverage/lcov.info | |
| target/coverage/html | |
| if-no-files-found: error | |
| release: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| needs: | |
| - lint-and-test | |
| - coverage | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Prepare release assets | |
| env: | |
| GIT_TAG: ${{ github.ref_name }} | |
| run: ./scripts/package-release-assets.sh "${GIT_TAG}" dist/release | |
| - name: Generate release notes | |
| env: | |
| GIT_TAG: ${{ github.ref_name }} | |
| run: ./scripts/generate-release-notes.sh "${GIT_TAG}" dist/release/release-notes.md | |
| - name: Publish release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GIT_TAG: ${{ github.ref_name }} | |
| run: | | |
| release_title="CRIEW ${GIT_TAG}" | |
| notes_file="dist/release/release-notes.md" | |
| tar_asset="dist/release/criew-${GIT_TAG}-src.tar.gz" | |
| zip_asset="dist/release/criew-${GIT_TAG}-src.zip" | |
| if gh release view "${GIT_TAG}" >/dev/null 2>&1; then | |
| gh release upload "${GIT_TAG}" \ | |
| "${tar_asset}" \ | |
| "${zip_asset}" \ | |
| --clobber | |
| gh release edit "${GIT_TAG}" \ | |
| --title "${release_title}" \ | |
| --notes-file "${notes_file}" | |
| else | |
| gh release create "${GIT_TAG}" \ | |
| "${tar_asset}" \ | |
| "${zip_asset}" \ | |
| --title "${release_title}" \ | |
| --notes-file "${notes_file}" | |
| fi |