Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
33 changes: 32 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
contents: read

jobs:
test:
registry:
name: Rust ${{ matrix.rust }} using ${{ matrix.registry }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -43,3 +43,34 @@ jobs:
- run: cargo init . --bin --name ci
- run: cargo add logging --registry ${{ matrix.registry }}
- run: cargo check

linker:
name: Rust ${{ matrix.rust }} with mold linker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4

- name: Set registry name
run: sed -i "s/REGISTRY/wafflehacks/g" .cargo/config.toml

- name: TheHackerApp/setup-rust@main
uses: ./
with:
ssh-private-key: ${{ secrets.SHIPYARD_SSH_KEY }}
token: ${{ secrets.SHIPYARD_TOKEN }}
toolchain: ${{ matrix.rust }}
with-mold: true

- run: cargo init . --bin --name ci
- run: cargo add rand
- run: cargo check
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-args=-fuse-ld=mold
21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ inputs:
components:
description: Comma-separated list of components to be additionally installed
required: false
with-mold:
description: Whether to install the mold linker
required: false
default: true
mold-version:
description: Version of the mold linker to install
required: false
default: "2.31.0"

runs:
using: composite
Expand Down Expand Up @@ -52,3 +60,16 @@ runs:
run: |
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV
echo "CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS=cargo:token" >> $GITHUB_ENV

- name: Install mold linker
shell: bash
if: inputs.with-mold == 'true'
run: |
wget -qO /tmp/mold.tar.gz https://github.com/rui314/mold/releases/download/v${{ inputs.mold-version }}/mold-${{ inputs.mold-version }}-x86_64-linux.tar.gz; \
sudo tar -xf /tmp/mold.tar.gz -C /usr/local --strip-components 1; \
rm /tmp/mold.tar.gz

- name: Install clang
shell: bash
if: inputs.with-mold == 'true'
run: sudo apt-get install -y clang libclang-dev