mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-31 16:33:10 +00:00
d913ec5173
Bumps the github-dependencies group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [taiki-e/install-action](https://github.com/taiki-e/install-action). Updates `actions/upload-artifact` from 4.5.0 to 4.6.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](6f51ac03b9...65c4c4a1dd
) Updates `taiki-e/install-action` from 2.47.8 to 2.47.9 - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](08d473f7b2...df5dec2a2f
) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
207 lines
7.4 KiB
YAML
207 lines
7.4 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
- '!main' # Don't build on main, because merge_group will do that already.
|
|
pull_request:
|
|
merge_group:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
permissions: read-all
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# macos-13 is x86; macos-14 is ARM
|
|
os: [ubuntu-24.04, macos-13, macos-14, windows-latest]
|
|
cargo_flags: [""]
|
|
include:
|
|
- os: ubuntu-24.04
|
|
cargo_flags: "--all-features"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
# TODO FIXME (aseipp): keep the timeout limit to ~15 minutes. this is long
|
|
# enough to give us runway for the future, but also once we hit it, we're at
|
|
# the "builds are taking too long" stage and we should start looking at ways
|
|
# to optimize the CI.
|
|
#
|
|
# at the same time, this avoids some issues where some flaky, bugged tests
|
|
# seem to be causing multi-hour runs on Windows (GPG signing issues), which
|
|
# is a problem we should fix. in the mean time, this will make these flakes
|
|
# less harmful, as it won't cause builds to spin for multiple hours, requiring
|
|
# manual cancellation.
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
# The default version of gpg installed on the runners is a version baked in with git
|
|
# which only contains the components needed by git and doesn't work for our test cases.
|
|
#
|
|
# This installs the latest gpg4win version, which is a variation of GnuPG built for
|
|
# Windows.
|
|
#
|
|
# There is some issue with windows PATH max length which is what all the PATH wrangling
|
|
# below is for. Please see the below link for where this fix was derived from:
|
|
# https://github.com/orgs/community/discussions/24933
|
|
- name: Setup GnuPG [windows]
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
run: |
|
|
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin"
|
|
[Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine")
|
|
choco install --yes gpg4win
|
|
echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> $env:GITHUB_PATH
|
|
|
|
# The default version of openssh on windows server is quite old (8.1) and doesn't have
|
|
# all the necessary signing/verification commands available (such as -Y find-principals)
|
|
- name: Setup ssh-agent [windows]
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
run: |
|
|
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
|
|
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
|
|
choco install openssh --pre
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
|
with:
|
|
toolchain: 1.76
|
|
- uses: taiki-e/install-action@df5dec2a2f73ff6dbace3072df1242669b7bb7d1
|
|
with:
|
|
tool: nextest
|
|
- name: Build
|
|
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
- name: Test
|
|
run: cargo nextest run --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
CARGO_TERM_COLOR: always
|
|
|
|
build-no-git:
|
|
name: Build without Git support
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
|
with:
|
|
toolchain: 1.76
|
|
- name: Build
|
|
run: cargo build -p jj-cli --no-default-features --verbose
|
|
|
|
check-protos:
|
|
name: Check protos
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
|
with:
|
|
toolchain: stable
|
|
- run: sudo apt update && sudo apt-get -y install protobuf-compiler
|
|
- name: Generate Rust code from .proto files
|
|
run: cargo run -p gen-protos
|
|
- name: Check for uncommitted changes
|
|
run: git diff --exit-code
|
|
|
|
rustfmt:
|
|
name: Check formatting
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt
|
|
- run: cargo +nightly fmt --all -- --check
|
|
|
|
check-doctests:
|
|
name: Run doctests
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: 1.76
|
|
# NOTE: We need to run `cargo test --doc` separately from normal tests:
|
|
# - `cargo build --all-targets` specifies: "Build all targets"
|
|
# - `cargo test --all-targets` specifies: "Test all targets (does not include doctests)"
|
|
- name: Run doctests
|
|
run: cargo test --workspace --doc
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
- name: Check `cargo doc` for lint issues
|
|
env:
|
|
RUSTDOCFLAGS: "--deny warnings"
|
|
run: cargo doc --workspace --no-deps
|
|
|
|
mkdocs:
|
|
name: Check that MkDocs can build the docs
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a
|
|
with:
|
|
# If you bump the version, also update docs/contributing.md
|
|
# and all other workflows that install uv
|
|
version: "0.5.1"
|
|
- name: Check that `mkdocs` can build the docs
|
|
run: uv run -- mkdocs build --strict
|
|
|
|
# An optional job to alert us when uv updates break the build
|
|
mkdocs-latest:
|
|
name: Check that MkDocs can build the docs with latest Python and uv
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a
|
|
# 'only-managed' means that uv will always download Python, even
|
|
# if the runner happens to provide a compatible version
|
|
- name: Check that `mkdocs` can build the docs
|
|
run: uv run --python-preference=only-managed -- mkdocs build --strict
|
|
|
|
cargo-deny:
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
matrix:
|
|
checks:
|
|
- advisories
|
|
- bans licenses sources
|
|
|
|
# Prevent sudden announcement of a new advisory from failing ci:
|
|
continue-on-error: ${{ matrix.checks == 'advisories' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: EmbarkStudios/cargo-deny-action@e2f4ede4a4e60ea15ff31bc0647485d80c66cfba
|
|
with:
|
|
command: check ${{ matrix.checks }}
|
|
|
|
clippy-check:
|
|
name: Clippy check
|
|
permissions:
|
|
checks: write
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|