mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-12 23:23:20 +00:00
643d772bab
Some checks are pending
binaries / Build binary artifacts (linux-aarch64-gnu, ubuntu-24.04, aarch64-unknown-linux-gnu) (push) Waiting to run
binaries / Build binary artifacts (linux-aarch64-musl, ubuntu-24.04, aarch64-unknown-linux-musl) (push) Waiting to run
binaries / Build binary artifacts (linux-x86_64-gnu, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Waiting to run
binaries / Build binary artifacts (linux-x86_64-musl, ubuntu-24.04, x86_64-unknown-linux-musl) (push) Waiting to run
binaries / Build binary artifacts (macos-aarch64, macos-14, aarch64-apple-darwin) (push) Waiting to run
binaries / Build binary artifacts (macos-x86_64, macos-13, x86_64-apple-darwin) (push) Waiting to run
binaries / Build binary artifacts (win-x86_64, windows-2022, x86_64-pc-windows-msvc) (push) Waiting to run
nix / flake check (macos-14) (push) Waiting to run
nix / flake check (ubuntu-latest) (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with Poetry 1.8 (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
When a pull request is pushed multiple times in sequence (e.g. to fix small errors that are noticed post-submission), a backlog of builds ends up needing to be cleared out before your new update can be built. If you push N times, N builds are queued and need to clear out first. This can cause higher latency for *every* PR since the pool of public runners is shared, and in general seems uneconomical and inefficient since 99% of the time you want to build the new version ASAP. Luckily GHA has a universal solution to this: use the `concurrency` directive to group all builds for a PR under a name, and when a new build appears in that group, cancel all builds in the group that are in-progress. Taken from this useful blog post: "Simple trick to save environment and money when using GitHub Actions" https://turso.tech/blog/simple-trick-to-save-environment-and-money-when-using-github-actions Signed-off-by: Austin Seipp <aseipp@pobox.com>
189 lines
6.7 KiB
YAML
189 lines
6.7 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
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-latest, macos-13, macos-14, windows-latest]
|
|
cargo_flags: [""]
|
|
include:
|
|
- os: ubuntu-latest
|
|
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@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: 1.76
|
|
- name: Build
|
|
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
- name: Test
|
|
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
build-no-git:
|
|
name: Build jj-lib without Git support
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: 1.76
|
|
- name: Build
|
|
run: cargo build -p jj-lib --no-default-features --verbose
|
|
|
|
check-protos:
|
|
name: Check protos
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
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-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt
|
|
- run: cargo +nightly fmt --all -- --check
|
|
|
|
mkdocs:
|
|
name: Check that MkDocs can build the docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install poetry (latest release)
|
|
uses: abatilo/actions-poetry@e78f54a89cb052fff327414dd9ff010b5d2b4dbd
|
|
with:
|
|
poetry-version: latest
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
- name: Check that `mkdocs` can build the docs
|
|
run: poetry run -- mkdocs build --strict
|
|
|
|
mkdocs-old-poetry:
|
|
name: Check that MkDocs can build the docs with Poetry 1.8
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install poetry
|
|
uses: abatilo/actions-poetry@e78f54a89cb052fff327414dd9ff010b5d2b4dbd
|
|
with:
|
|
# Test with the version of Poetry in Debian stable. If this starts
|
|
# failing, we should increase this version and document the minimum
|
|
# necessary version of Poetry in contributing.md.
|
|
#
|
|
# One way to install old `poetry` is using `pipx`:
|
|
# pipx install 'poetry<1.4' --suffix -1.3
|
|
poetry-version: 1.8
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
- name: Check that `mkdocs` can build the docs
|
|
run: poetry run -- mkdocs build --strict
|
|
|
|
cargo-deny:
|
|
runs-on: ubuntu-latest
|
|
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@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268
|
|
with:
|
|
command: check ${{ matrix.checks }}
|
|
|
|
clippy-check:
|
|
name: Clippy check
|
|
permissions:
|
|
checks: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|