CI: Build Windows binary in a separate job
This commit is contained in:
parent
3494ba71e6
commit
e1498a317b
5 changed files with 77 additions and 18 deletions
|
|
@ -3,3 +3,4 @@ allow-expect-in-tests = true
|
|||
single-char-binding-names-threshold = 2
|
||||
upper-case-acronyms-aggressive = true
|
||||
allow-indexing-slicing-in-tests = true
|
||||
check-incompatible-msrv-in-tests = true
|
||||
|
|
|
|||
|
|
@ -9,10 +9,21 @@ on:
|
|||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
linux:
|
||||
description: 'Build Linux binaries'
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
windows:
|
||||
description: 'Build Windows binary'
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: docker
|
||||
if: ${{ inputs.linux }}
|
||||
timeout-minutes: 20
|
||||
container:
|
||||
image: rust:slim
|
||||
|
|
@ -31,7 +42,6 @@ jobs:
|
|||
rustup component add --toolchain nightly rustfmt clippy
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
rustup target add x86_64-pc-windows-msvc
|
||||
|
||||
- name: Setup additional tooling
|
||||
run: .forgejo/workflows/setup-tools.sh
|
||||
|
|
@ -50,9 +60,6 @@ jobs:
|
|||
- name: Build x64 Linux musl release binary
|
||||
run: just release-build-musl
|
||||
|
||||
- name: Build x64 Windows MSVC release binary
|
||||
run: just release-build-msvc
|
||||
|
||||
- name: Calculate SHA-256 hashes
|
||||
run: just shasum
|
||||
|
||||
|
|
@ -78,6 +85,45 @@ jobs:
|
|||
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
|
||||
--upload-file target/x86_64-unknown-linux-gnu/release/en $url
|
||||
|
||||
publish-windows:
|
||||
runs-on: docker
|
||||
if: ${{ inputs.windows }}
|
||||
timeout-minutes: 20
|
||||
container:
|
||||
image: messense/cargo-xwin
|
||||
steps:
|
||||
- name: Install action dependencies
|
||||
run: apt-get install --no-install-recommends --update -y nodejs curl git
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-tags: true
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
run: |
|
||||
target="x86_64-pc-windows-msvc"
|
||||
version=$(cat Cargo.toml | grep '^rust-version' | cut -d \" -f 2)
|
||||
rustup toolchain install --force-non-host "$version-$target"
|
||||
rustup default "$version-$target"
|
||||
|
||||
- name: Setup additional tooling
|
||||
run: .forgejo/workflows/setup-tools.sh
|
||||
|
||||
- name: Setup CI user
|
||||
run: |
|
||||
useradd -m ci && chown -R ci:ci .
|
||||
git config --global --add safe.directory "$PWD"
|
||||
|
||||
- name: Run Windows tests
|
||||
run: just ci test-windows
|
||||
|
||||
- name: Build x64 Windows MSVC release binary
|
||||
run: just release-build-msvc
|
||||
|
||||
- name: Calculate SHA-256 hashes
|
||||
run: just shasum
|
||||
|
||||
- name: Publish x64 Windows MSVC binary to git.jutty.dev registry
|
||||
if: ${{ inputs.upload }}
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ TYPOS_VERSION="1.47.2"
|
|||
TYPOS_SHA256SUM="7aef58932fc123b4cf4b40d86468e89a3297d80169051d7cfd13a235e05fc426"
|
||||
CARGO_DENY_VERSION="0.19.8"
|
||||
CARGO_DENY_SHA256SUM="70e769ae3872e34d45132b17040859175e11401dc12dddb0303e0b8c7d088f3f"
|
||||
CARGO_XWIN_VERSION="0.23.0"
|
||||
CARGO_XWIN_SHA256SUM="74a216f64f10ea81c909f02d6b1a84cd0fda8de4c87ee52fe63ba76ab2392b75"
|
||||
|
||||
TRIPLE="x86_64-unknown-linux-gnu"
|
||||
TRIPLE_MUSL="x86_64-unknown-linux-musl"
|
||||
|
|
@ -75,7 +73,3 @@ fetch crate-ci/typos "v$TYPOS_VERSION" \
|
|||
fetch EmbarkStudios/cargo-deny "$CARGO_DENY_VERSION" \
|
||||
cargo-deny-$CARGO_DENY_VERSION-$TRIPLE_MUSL.tar.gz \
|
||||
"$CARGO_DENY_SHA256SUM" cargo-deny
|
||||
|
||||
fetch rust-cross/cargo-xwin "v$CARGO_XWIN_VERSION" \
|
||||
cargo-xwin-v$CARGO_XWIN_VERSION.$TRIPLE_MUSL.tar.gz \
|
||||
"$CARGO_XWIN_SHA256SUM" cargo-xwin
|
||||
|
|
|
|||
30
.justfile
30
.justfile
|
|
@ -72,6 +72,17 @@ assess-run-watch-quick:
|
|||
|
||||
alias rq := assess-run-watch-quick
|
||||
|
||||
# Determine the Minimum Supported Rust Version
|
||||
[group: 'develop']
|
||||
msrv:
|
||||
@{{ make_msrv("find", musl_target) }}
|
||||
@{{ make_msrv("find", glibc_target) }}
|
||||
@{{ make_msrv("find", msvc_target) }}
|
||||
|
||||
make_msrv(command, target) := f"printf '{{ target }}: '; " + \
|
||||
f"cargo msrv {{ command }} --target {{ target }} --output-format minimal " \
|
||||
+ f"-- {{ maybe_xwin(target) }} build --ignore-rust-version"
|
||||
|
||||
[private]
|
||||
test-cover-quick:
|
||||
{{ cover_cmd }} --no-report -- --test 'serial_tests::' --test-threads 1
|
||||
|
|
@ -321,6 +332,8 @@ test-windows pattern="":
|
|||
-{{ xwin_test(pattern) }} --timings --doc
|
||||
-{{ xwin_test(pattern) }} --timings --lib -- --skip 'serial_tests::'
|
||||
|
||||
xwin_test(pattern) := f"cargo-xwin test {{ pattern }} --target {{ msvc_target }}"
|
||||
|
||||
# Run tests with unfiltered output
|
||||
[group: 'assess']
|
||||
test-output pattern="":
|
||||
|
|
@ -361,7 +374,7 @@ verify:
|
|||
fi
|
||||
{{ just_cmd }} \
|
||||
todos-assess version-assess spell schema-lint deny \
|
||||
format-assess lint-assess check \
|
||||
format-assess lint-assess msrv-assess check \
|
||||
test "" cover-assess
|
||||
|
||||
alias v := verify
|
||||
|
|
@ -387,6 +400,13 @@ version-assess remote="false": update
|
|||
|
||||
alias va := version-assess
|
||||
|
||||
# Assess if the current Minimum Supported Rust Version is accurate
|
||||
[group: 'assess']
|
||||
msrv-assess:
|
||||
{{ make_msrv("verify", musl_target) }}
|
||||
{{ make_msrv("verify", glibc_target) }}
|
||||
{{ make_msrv("verify", msvc_target) }}
|
||||
|
||||
# Find TODOs
|
||||
[group: 'assess']
|
||||
todos-assess:
|
||||
|
|
@ -448,6 +468,9 @@ release-build target=default_target:
|
|||
--timings --target {{ target }} --locked --release
|
||||
du -h target/{{ target }}/release/{{ with_suffix("en", target) }}
|
||||
|
||||
maybe_xwin(target) := if target == msvc_target { "cargo-xwin" } else { "cargo" }
|
||||
with_suffix(file, target) := if target == msvc_target { f"{{ file }}.exe" } else { file }
|
||||
|
||||
alias rb := release-build
|
||||
|
||||
# glibc release build
|
||||
|
|
@ -513,11 +536,6 @@ lockfile_version := ```
|
|||
| grep version | cut -d '"' -f 2
|
||||
```
|
||||
|
||||
## FUNCTIONS
|
||||
with_suffix(file, target) := if target == msvc_target { f"{{ file }}.exe" } else { file }
|
||||
maybe_xwin(target) := if target == msvc_target { "cargo-xwin" } else { "cargo" }
|
||||
xwin_test(pattern) := f"cargo-xwin test {{ pattern }} --target {{ msvc_target }}"
|
||||
|
||||
## OPTIONS
|
||||
set unstable
|
||||
set lazy
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ homepage = "https://en.jutty.dev"
|
|||
documentation = "https://en.jutty.dev/node/Documentation"
|
||||
|
||||
edition = "2024"
|
||||
rust-version= "1.94.0"
|
||||
rust-version= "1.91.1"
|
||||
|
||||
[features]
|
||||
serial-tests = []
|
||||
|
|
@ -96,7 +96,6 @@ float_cmp_const = "warn"
|
|||
fn_to_numeric_cast_any = "warn"
|
||||
format_collect = "warn"
|
||||
format_push_string = "warn"
|
||||
from_iter_instead_of_collect = "warn"
|
||||
get_unwrap = "warn"
|
||||
if_not_else = "warn"
|
||||
if_then_some_else_none = "warn"
|
||||
|
|
@ -105,6 +104,7 @@ ignored_unit_patterns = "warn"
|
|||
implicit_clone = "warn"
|
||||
implicit_hasher = "warn"
|
||||
imprecise_flops = "warn"
|
||||
incompatible_msrv = "warn"
|
||||
inconsistent_struct_constructor = "warn"
|
||||
index_refutable_slice = "warn"
|
||||
indexing_slicing = "warn"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue