2021-03-11 07:02:24 +00:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
github: don't run build workflows twice on push to `main`
The new `merge_group` event will already attach all the CI events from the
various workflows where it applies. If the merge queue is drained and merges to
`main`, having `push` on these workflows will cause them to be run again, doubling
the number of CI checks. We don't need `push` anymore, basically.
Also, because checks can be cancelled now, the current double running can
probably lead to an awkward setup like:
- Merge Queue merges A to main, starts `push` workflows
- Merge Queue then merges B and C to main, starts `push` workflows
- `A`'s workflows get cancelled if it's not yet done
- This makes it look like `A` has failing tests somehow, but it doesn't
Therefore, just removing the double builds is the first step to cut down on the
CI times for our repo.
We also run the build workflows on all pushes to NOT main, because that will
help people who want to run CI before opening an actual PR.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-08 21:48:14 +00:00
|
|
|
branches:
|
|
|
|
- '**'
|
2025-01-10 01:14:42 +00:00
|
|
|
# Disable builds on these branches, because they will become a pull
|
|
|
|
# request, and be handled by merge_group below.
|
|
|
|
- '!dependabot/**'
|
|
|
|
# `main` and `gh-readonly-queue` are handled by merge_group specifically.
|
|
|
|
- '!gh-readonly-queue/**'
|
|
|
|
- '!main'
|
2021-03-11 07:02:24 +00:00
|
|
|
pull_request:
|
2025-01-08 02:46:21 +00:00
|
|
|
merge_group:
|
2021-03-11 07:02:24 +00:00
|
|
|
|
2024-11-06 05:34:59 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
2025-01-08 22:00:31 +00:00
|
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
2024-11-06 05:34:59 +00:00
|
|
|
|
2022-03-16 19:18:01 +00:00
|
|
|
permissions: read-all
|
|
|
|
|
2023-07-10 07:01:17 +00:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
|
2021-03-11 07:02:24 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
2022-04-19 22:39:19 +00:00
|
|
|
fail-fast: false
|
2021-03-11 07:02:24 +00:00
|
|
|
matrix:
|
2024-08-09 00:27:13 +00:00
|
|
|
# macos-13 is x86; macos-14 is ARM
|
2025-01-06 23:12:36 +00:00
|
|
|
os: [ubuntu-24.04, macos-13, macos-14, windows-latest]
|
2023-03-29 17:22:50 +00:00
|
|
|
cargo_flags: [""]
|
2022-04-19 22:39:19 +00:00
|
|
|
include:
|
2025-01-06 23:12:36 +00:00
|
|
|
- os: ubuntu-24.04
|
2023-03-29 17:22:50 +00:00
|
|
|
cargo_flags: "--all-features"
|
2022-04-19 22:39:19 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-03-11 07:02:24 +00:00
|
|
|
|
2024-02-23 07:20:19 +00:00
|
|
|
# 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
|
|
|
|
|
2021-03-11 07:02:24 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-02-13 01:53:54 +00:00
|
|
|
|
|
|
|
# The default version of gpg installed on the runners is a version baked in with git
|
2024-11-09 21:32:29 +00:00
|
|
|
# which only contains the components needed by git and doesn't work for our test cases.
|
2024-02-13 01:53:54 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
2024-02-07 14:09:25 +00:00
|
|
|
# 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
|
|
|
|
|
2023-07-29 17:16:04 +00:00
|
|
|
- name: Install Rust
|
2024-12-16 15:35:12 +00:00
|
|
|
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
2021-03-11 07:02:24 +00:00
|
|
|
with:
|
2024-12-08 20:28:31 +00:00
|
|
|
toolchain: 1.76
|
2025-01-09 17:24:43 +00:00
|
|
|
- uses: taiki-e/install-action@df5dec2a2f73ff6dbace3072df1242669b7bb7d1
|
2025-01-07 23:18:48 +00:00
|
|
|
with:
|
|
|
|
tool: nextest
|
2021-03-11 07:02:24 +00:00
|
|
|
- name: Build
|
2023-03-29 17:22:50 +00:00
|
|
|
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
2021-03-11 07:02:24 +00:00
|
|
|
- name: Test
|
2025-01-07 23:18:48 +00:00
|
|
|
run: cargo nextest run --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
2021-06-14 05:06:39 +00:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2025-01-07 23:18:48 +00:00
|
|
|
CARGO_TERM_COLOR: always
|
2021-03-23 17:30:05 +00:00
|
|
|
|
2024-06-08 00:02:36 +00:00
|
|
|
build-no-git:
|
cli: make git support optional
There are some experiments to try and compile `jj` to WebAssembly, so that we
might be able to do things like interactive web tutorials. One step for that
is making `git` support in `jj-cli` optional, because we can stub it out for
something more appropriate and it's otherwise a lot of porting annoyance for
both gitoxide and libgit2.
(On top of that, it might be a useful build configuration for other experiments
of mine where removing the need for the large libgit2 depchain is useful.)
As part of this, we need to mark `jj-lib` as having `default-features = false`
in the workspace dependency configuration; otherwise, the default behavior
for Cargo is to compile with all its default features, i.e. with git support
enabled, ignoring the `jj-cli` features clauses.
Other than that, it is fairly straightforward junk; it largely just sprinkles
some `#[cfg]` around liberally in order to make things work. It also adjusts the
CI pipeline so this is tested there, too, so we can progressively clean it up.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-03 04:52:52 +00:00
|
|
|
name: Build without Git support
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2024-06-08 00:02:36 +00:00
|
|
|
|
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-06-08 00:02:36 +00:00
|
|
|
|
|
|
|
- name: Install Rust
|
2024-12-16 15:35:12 +00:00
|
|
|
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
2024-06-08 00:02:36 +00:00
|
|
|
with:
|
2024-12-08 20:28:31 +00:00
|
|
|
toolchain: 1.76
|
2024-06-08 00:02:36 +00:00
|
|
|
- name: Build
|
cli: make git support optional
There are some experiments to try and compile `jj` to WebAssembly, so that we
might be able to do things like interactive web tutorials. One step for that
is making `git` support in `jj-cli` optional, because we can stub it out for
something more appropriate and it's otherwise a lot of porting annoyance for
both gitoxide and libgit2.
(On top of that, it might be a useful build configuration for other experiments
of mine where removing the need for the large libgit2 depchain is useful.)
As part of this, we need to mark `jj-lib` as having `default-features = false`
in the workspace dependency configuration; otherwise, the default behavior
for Cargo is to compile with all its default features, i.e. with git support
enabled, ignoring the `jj-cli` features clauses.
Other than that, it is fairly straightforward junk; it largely just sprinkles
some `#[cfg]` around liberally in order to make things work. It also adjusts the
CI pipeline so this is tested there, too, so we can progressively clean it up.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-03 04:52:52 +00:00
|
|
|
run: cargo build -p jj-cli --no-default-features --verbose
|
2024-06-08 00:02:36 +00:00
|
|
|
|
2022-12-21 19:14:46 +00:00
|
|
|
check-protos:
|
|
|
|
name: Check protos
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2022-12-21 19:14:46 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-12-16 15:35:12 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
2022-12-21 19:14:46 +00:00
|
|
|
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
|
|
|
|
|
2022-03-08 05:02:25 +00:00
|
|
|
rustfmt:
|
|
|
|
name: Check formatting
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2022-03-08 05:02:25 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-12-16 15:35:12 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
2022-03-08 05:02:25 +00:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
2023-07-11 13:08:13 +00:00
|
|
|
- run: cargo +nightly fmt --all -- --check
|
2022-03-08 05:02:25 +00:00
|
|
|
|
2024-12-10 00:41:47 +00:00
|
|
|
check-doctests:
|
|
|
|
name: Run doctests
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2024-12-10 00:41:47 +00:00
|
|
|
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
|
|
|
|
|
2023-08-30 05:27:02 +00:00
|
|
|
mkdocs:
|
|
|
|
name: Check that MkDocs can build the docs
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2023-08-30 05:27:02 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-10-24 15:27:46 +00:00
|
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
2023-08-30 05:27:02 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.11
|
2024-11-09 21:32:29 +00:00
|
|
|
- name: Install uv
|
2024-12-24 15:41:53 +00:00
|
|
|
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a
|
2023-08-30 05:27:02 +00:00
|
|
|
with:
|
2024-11-09 21:32:29 +00:00
|
|
|
# If you bump the version, also update docs/contributing.md
|
|
|
|
# and all other workflows that install uv
|
|
|
|
version: "0.5.1"
|
2023-08-30 05:27:02 +00:00
|
|
|
- name: Check that `mkdocs` can build the docs
|
2024-11-09 21:32:29 +00:00
|
|
|
run: uv run -- mkdocs build --strict
|
2023-11-05 23:24:38 +00:00
|
|
|
|
2024-11-09 21:32:29 +00:00
|
|
|
# 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
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2023-11-05 23:24:38 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-11-09 21:32:29 +00:00
|
|
|
- name: Install uv
|
2024-12-24 15:41:53 +00:00
|
|
|
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a
|
2024-11-09 21:32:29 +00:00
|
|
|
# 'only-managed' means that uv will always download Python, even
|
|
|
|
# if the runner happens to provide a compatible version
|
2023-11-05 23:24:38 +00:00
|
|
|
- name: Check that `mkdocs` can build the docs
|
2024-11-09 21:32:29 +00:00
|
|
|
run: uv run --python-preference=only-managed -- mkdocs build --strict
|
2023-08-30 05:27:02 +00:00
|
|
|
|
2022-08-22 18:33:45 +00:00
|
|
|
cargo-deny:
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2022-08-22 18:33:45 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
checks:
|
|
|
|
- advisories
|
|
|
|
- bans licenses sources
|
|
|
|
|
|
|
|
# Prevent sudden announcement of a new advisory from failing ci:
|
|
|
|
continue-on-error: ${{ matrix.checks == 'advisories' }}
|
|
|
|
|
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-12-04 15:36:31 +00:00
|
|
|
- uses: EmbarkStudios/cargo-deny-action@e2f4ede4a4e60ea15ff31bc0647485d80c66cfba
|
2022-08-22 18:33:45 +00:00
|
|
|
with:
|
|
|
|
command: check ${{ matrix.checks }}
|
|
|
|
|
2022-05-03 21:08:55 +00:00
|
|
|
clippy-check:
|
|
|
|
name: Clippy check
|
2022-03-19 05:19:24 +00:00
|
|
|
permissions:
|
|
|
|
checks: write
|
2025-01-06 23:12:36 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2022-02-24 04:14:47 +00:00
|
|
|
steps:
|
2024-10-23 15:56:10 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2024-12-16 15:35:12 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
|
2022-02-24 04:14:47 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: clippy
|
2023-07-11 13:08:13 +00:00
|
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|