Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 59 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ 'main' ]
branches: ['main']
pull_request:
branches: [ '**' ]
branches: ['**']
workflow_dispatch:

permissions: {}
Expand Down Expand Up @@ -107,50 +107,65 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# This is where we check that we're not using features from a more recent rust version. When
# updating this, please also update workspace.package.rust-version in `Cargo.toml`.
- uses: dtolnay/rust-toolchain@1.93.0
id: rust-toolchain
with:
components: clippy
- uses: wild-linker/action@latest
with:
- uses: actions/checkout@v6
with:
persist-credentials: false
# This is where we check that we're not using features from a more recent rust version. When
# updating this, please also update workspace.package.rust-version in `Cargo.toml`.
- uses: dtolnay/rust-toolchain@1.93.0
id: rust-toolchain
with:
components: clippy
- uses: davidlattimore/wild-action@latest
Comment thread
fahdfady marked this conversation as resolved.
Outdated
with:
wild-version: "0.8.0"
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --target x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --target x86_64-unknown-linux-gnu

rustfmt:
name: Check formatting
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check

yamlfmt:
name: yamlfmt
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v5
Comment thread
fahdfady marked this conversation as resolved.
Outdated
with:
go-version: '1.26.0'
- run: go install github.com/google/yamlfmt/cmd/yamlfmt@v0.17.2
Comment thread
fahdfady marked this conversation as resolved.
Outdated
- run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- run: yamlfmt -lint .

riscv-build:
name: RISC-V build
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: riscv64gc-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update && sudo apt-get install build-essential lld gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- run: cp .cargo/config.toml.cross-riscv .cargo/config.toml
- run: cargo build --target riscv64gc-unknown-linux-gnu
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: riscv64gc-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update && sudo apt-get install build-essential lld gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- run: cp .cargo/config.toml.cross-riscv .cargo/config.toml
- run: cargo build --target riscv64gc-unknown-linux-gnu

loongarch64-build:
name: LoongArch64 build
Expand All @@ -159,17 +174,17 @@ jobs:
container:
image: ubuntu:25.10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: apt-get update && apt-get install -y build-essential lld gcc gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu curl
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: loongarch64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: cp .cargo/config.toml.cross-loongarch64 .cargo/config.toml
- run: cargo build --target loongarch64-unknown-linux-gnu
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: apt-get update && apt-get install -y build-essential lld gcc gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu curl
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: loongarch64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: cp .cargo/config.toml.cross-loongarch64 .cargo/config.toml
- run: cargo build --target loongarch64-unknown-linux-gnu

spelling:
name: Spell Check with Typos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Refresh Nix Cache

on:
push:
branches: [ 'main' ]
branches: ['main']
paths:
- flake.lock
- Cargo.lock
Expand Down
142 changes: 71 additions & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
paths:
- .github/workflows/release.yml

# Allow manually triggering workflow for testing purposes. As with pull requests, the actual
# release won't get created.
workflow_dispatch:
Expand All @@ -30,74 +30,74 @@ jobs:
fail-fast: false
matrix:
include:
- { target: x86_64-unknown-linux-gnu, runs-on: ubuntu-22.04 }
- { target: aarch64-unknown-linux-gnu, runs-on: ubuntu-22.04-arm }
- { target: riscv64gc-unknown-linux-gnu, runs-on: ubuntu-22.04-arm, build: zigbuild }

- { target: x86_64-unknown-linux-musl, runs-on: ubuntu-22.04, musl: true, args: --features=mimalloc }
- { target: aarch64-unknown-linux-musl, runs-on: ubuntu-22.04-arm, musl: true, args: --features=mimalloc }
- { target: riscv64gc-unknown-linux-musl, runs-on: ubuntu-22.04-arm, build: zigbuild, args: --features=mimalloc }
- {target: x86_64-unknown-linux-gnu, runs-on: ubuntu-22.04}
- {target: aarch64-unknown-linux-gnu, runs-on: ubuntu-22.04-arm}
- {target: riscv64gc-unknown-linux-gnu, runs-on: ubuntu-22.04-arm, build: zigbuild}

- {target: x86_64-unknown-linux-musl, runs-on: ubuntu-22.04, musl: true, args: --features=mimalloc}
- {target: aarch64-unknown-linux-musl, runs-on: ubuntu-22.04-arm, musl: true, args: --features=mimalloc}
- {target: riscv64gc-unknown-linux-musl, runs-on: ubuntu-22.04-arm, build: zigbuild, args: --features=mimalloc,}
Comment thread
lapla-cogito marked this conversation as resolved.

steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y clang
if: matrix.build != 'zigbuild'

- name: Install musl tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
if: matrix.musl == true

- name: Checkout code
uses: actions/checkout@v6
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: taiki-e/install-action@cargo-zigbuild
if: matrix.build == 'zigbuild'
- uses: mlugg/setup-zig@v2
if: matrix.build == 'zigbuild'
with:
use-cache: false

- name: Extract release notes
if: env.IS_RELEASE == 'true'
shell: bash
run: |
awk "/## ${VERSION_TAG}/{flag=1; next} /^## / && flag{exit} flag" CHANGELOG.md >REL.md

- name: Build stage1
run: cargo build --release

- name: Switch to linking with wild
if: matrix.build != 'zigbuild' # zigbuild ignores this config
run: |
mkdir -p "$HOME/.cargo"
WILD="${PWD}/target/release/wild"
$WILD --version
echo -e "[target.${{matrix.target}}]\nlinker = \"clang\"\nrustflags = [\"-Clink-arg=--ld-path=$WILD\"]\n" >>"$HOME/.cargo/config.toml"
cat "$HOME/.cargo/config.toml"

- name: Build release binary
run: cargo ${{matrix.build || 'build' }} ${{matrix.args}} --profile dist --target ${{ matrix.target }}

- name: Create tarballs
run: |
n="wild-linker-${VERSION_TAG}-${{ matrix.target }}"
mkdir "$n"
cp "target/${{ matrix.target }}/dist/wild" "$n"
cp README.md LICENSE* CHANGELOG.md "$n"
readelf -p .comment "$n/wild" | grep "Linker: Wild" || echo "::warning::'$n' wasn't linked with wild"
tar zcf $n.tar.gz $n

- name: Release
if: env.IS_RELEASE == 'true'
uses: softprops/action-gh-release@v2
with:
body_path: REL.md
draft: true
files: |
wild-linker-*.tar.gz
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y clang
if: matrix.build != 'zigbuild'

- name: Install musl tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
if: matrix.musl == true

- name: Checkout code
uses: actions/checkout@v6
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: taiki-e/install-action@cargo-zigbuild
if: matrix.build == 'zigbuild'
- uses: mlugg/setup-zig@v2
if: matrix.build == 'zigbuild'
with:
use-cache: false

- name: Extract release notes
if: env.IS_RELEASE == 'true'
shell: bash
run: |
awk "/## ${VERSION_TAG}/{flag=1; next} /^## / && flag{exit} flag" CHANGELOG.md >REL.md

- name: Build stage1
run: cargo build --release

- name: Switch to linking with wild
if: matrix.build != 'zigbuild' # zigbuild ignores this config
run: |
mkdir -p "$HOME/.cargo"
WILD="${PWD}/target/release/wild"
$WILD --version
echo -e "[target.${{matrix.target}}]\nlinker = \"clang\"\nrustflags = [\"-Clink-arg=--ld-path=$WILD\"]\n" >>"$HOME/.cargo/config.toml"
cat "$HOME/.cargo/config.toml"

- name: Build release binary
run: cargo ${{matrix.build || 'build' }} ${{matrix.args}} --profile dist --target ${{ matrix.target }}

- name: Create tarballs
run: |
n="wild-linker-${VERSION_TAG}-${{ matrix.target }}"
mkdir "$n"
cp "target/${{ matrix.target }}/dist/wild" "$n"
cp README.md LICENSE* CHANGELOG.md "$n"
readelf -p .comment "$n/wild" | grep "Linker: Wild" || echo "::warning::'$n' wasn't linked with wild"
tar zcf $n.tar.gz $n

- name: Release
if: env.IS_RELEASE == 'true'
uses: softprops/action-gh-release@v2
with:
body_path: REL.md
draft: true
files: |
wild-linker-*.tar.gz
3 changes: 3 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
formatter:
retain_line_breaks: true
eof_newline: true
Loading