summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2022-12-17 13:27:18 +0000
committerGitHub <noreply@github.com>2022-12-17 13:27:18 +0000
commitd1f50150f6f7525f93ccb9ed94f75ce6bfb5c60b (patch)
tree4c5ebcf6016f134a21857dbcbbe195bee6664bf9 /.github
parent6e93e8ffce24e28af4bd35bacb48424d9e1d7a26 (diff)
WIP: Use `xtask` as build system (#2012)
* xtask: Implement a new build system xtask is a cargo alias that is used to extend the cargo build system with custom commands. For an introduction to xtask, see here: https://github.com/matklad/cargo-xtask/ The idea is that instead of writing makefiles, xtask requires no additional dependencies except `cargo` and `rustc`, which must be available to build the project anyway. This commit provides a basic implementation of the `build` and `test` subcommands. * xtask/deps: Add 'which' * xtask/test: Handle error when cargo not found * xtask/flags: Add more commands to perform different useful tasks. Includes: - clippy - format - "make" (composite) - "install" (composite) Also add more options to `build` to selectively compile plugins or leave them out entirely. * xtask/main: Return error when cargo not found * xtask/build: Add more subtasks - `wasm_opt_plugins` and - `manpage` that perform other build commands. Add thorough documentation on what each of these does and also handle the new `build` cli flags appropriately. * xtask/clippy: Add job to run clippy * xtask/format: Add job to run rustfmt * xtask/pipeline: Add composite commands that perform multiple atomic xtask commands sequentially in a pipeline sort of fashion. * xtask/deps: Pin dependencies * xtask/main: Integrate new jobs and add documentation. * xtask: Implement 'dist' which performs an 'install' and copies the resulting zellij binary along with some other assets to a `target/dist` folder. * cargo: Update xflags version * xtask: Measure task time, update tty title * xtask: Update various tasks * xtask: wasm-opt plugins in release builds automatically. * xtask/build: Copy debug plugins to assets folder * xtask: Add 'run' subcommand * xtask: Add arbitrary args to test and run * xtask: Rearrange CLI commands in help * xtask: Add deprecation notice * docs: Replace `cargo make` with `xtask` * github: Use `xtask` in workflows. * xtask: Add support for CI commands * xtask: Streamline error handling * github: Use new xtask commands in CI * xtask: Add 'publish' job * xtask/publish: Add retry when publish fails * xtask: Apply rustfmt * xtask: Refine 'make' deprecation warning * xtask: add task to build manpage * contributing: Fix e2e commands * xtask/run: Add missing `--` to pass all arguments following `xtask run` directly to the zellij binary being run. * xtask: Stay in invocation dir and make all tasks that need it change to the project root dir themselves. * xtask/run: Add `--data-dir` flag which will allow very quick iterations when not changing the plugins between builds. * xtask/ci: Install dependencies without asking * utils: Allow including plugins from target folder * utils/assets: Reduce asset map complexity * utils/consts: Update asset map docs * xtask: Fix plugin includes * xtask/test: Build plugins first because the zellij binary needs to include the plugins. * xtask/test: Fix formatting * xtask: Add notice on how to disable it
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/e2e.yml6
-rw-r--r--.github/workflows/release.yml5
-rw-r--r--.github/workflows/rust.yml14
3 files changed, 7 insertions, 18 deletions
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 22c243e1f..959bf7ec0 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -41,13 +41,11 @@ jobs:
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Add musl target
run: rustup target add x86_64-unknown-linux-musl
- - name: Install cargo-make
- run: nix profile install nixpkgs#cargo-make
- name: Install wasm-opt
run: sudo apt-get install -y --no-install-recommends binaryen
#run: cargo install --debug cargo-make
- name: Build asset
- run: cargo make build-e2e
+ run: cargo xtask ci e2e --build
# we copy this manually into the target folder instead of mounting it because
# github actions creates the service first, and if it has a mount that is part
# of your yet unchecked out code, you cannot checkout the code after the mount
@@ -60,4 +58,4 @@ jobs:
with:
args: docker restart ssh
- name: Test
- run: cargo make e2e-test
+ run: cargo xtask ci e2e --test
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bf7bc64a7..a47054675 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -59,9 +59,6 @@ jobs:
- name: Add WASM target
run: rustup target add wasm32-wasi
- - name: Install cargo-make
- run: cargo install --debug cargo-make
-
- name: Install musl-tools
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y --no-install-recommends musl-tools
@@ -83,7 +80,7 @@ jobs:
EOF
- name: Build release binary
- run: cargo make ci-build-release ${{ matrix.target }}
+ run: cargo xtask ci cross ${{ matrix.target }}
# this breaks on aarch64 and this if conditional isn't working for some reason: TODO: investigate
#- name: Strip release binary
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 5fed5058c..06db6d82d 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -32,12 +32,10 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Add WASM target
run: rustup target add wasm32-wasi
- - name: Install cargo-make
- run: test -x "${HOME}/.cargo/bin/cargo-make" || cargo install --debug cargo-make
- name: Build
- run: cargo make build
+ run: cargo xtask build
- name: Test
- run: cargo make test
+ run: cargo xtask test
format:
name: Check Formatting
@@ -53,10 +51,8 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- - name: Install cargo-make
- run: test -x "${HOME}/.cargo/bin/cargo-make" || cargo install --debug cargo-make
- name: Check Format
- run: cargo make check-format
+ run: cargo xtask format --check
clippy:
name: Check Clippy Lints
@@ -72,7 +68,5 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- - name: Install cargo-make
- run: test -x "${HOME}/.cargo/bin/cargo-make" || cargo install --debug cargo-make
- name: Check clippy lints
- run: cargo make clippy
+ run: cargo xtask clippy