Skip to content

Commit

Permalink
Update the CI actions and use the new linker with llvm-link
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Dec 12, 2023
1 parent 4761d5c commit 58b0df7
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 39 deletions.
88 changes: 74 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,39 @@ on:
pull_request:
branches:
- '*'
# Stop scheduled CI until const traits are back
# schedule:
# - cron: '0 0 * * MON'
schedule:
- cron: '0 0 * * MON'

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Check
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
target: nvptx64-nvidia-cuda
override: true

- name: Install the rust-ptx-linker
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
rm llvm.sh
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
- name: Check without features on CPU
run: |
Expand Down Expand Up @@ -74,11 +90,13 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v2
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]

steps:
- name: Install CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
Expand All @@ -89,8 +107,23 @@ jobs:
sudo apt-get update -q
sudo apt-get install cuda -y --no-install-recommends
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
target: nvptx64-nvidia-cuda
override: true

- name: Install the rust-ptx-linker
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
rm llvm.sh
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
- name: Run the test-suite
run: |
Expand All @@ -99,22 +132,49 @@ jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true

- name: Check the code formatting
run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
components: clippy
target: nvptx64-nvidia-cuda
override: true

- name: Install the rust-ptx-linker
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
rm llvm.sh
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
- name: Check the code style without features on CPU
run: |
Expand Down
50 changes: 36 additions & 14 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ jobs:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
Expand All @@ -22,21 +19,45 @@ jobs:
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update -q
sudo apt-get install cuda -y --no-install-recommends
- name: Download grcov
run: |
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
chmod +x ./grcov
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: |
cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
cargo install grcov --force --locked
rustup component add llvm-tools-preview
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: llvm-tools-preview
target: nvptx64-nvidia-cuda
override: true

- name: Generate the code coverage
- name: Install the rust-ptx-linker
run: |
RUSTFLAGS="-Cinstrument-coverage" \
LLVM_PROFILE_FILE="codecov-%p-%m.profraw" \
cargo test --workspace
grcov . -s . --binary-path ./target/debug/ \
-t cobertura -o cobertura.xml --branch \
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
rm llvm.sh
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
- name: Generate the coverage data
run: |
cargo clean
cargo test --workspace --all-targets
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: -Cinstrument-coverage
RUSTDOCFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: coverage/coverage-%p-%m.profraw

- name: Generate the coverage reports
run: |
./grcov . -s . --binary-path ./target/debug/deps \
-t lcov -o coverage.lcov --branch \
--keep-only "src/*" \
--keep-only "rust-cuda-ptx-jit/*" \
--keep-only "rust-cuda-derive/*" \
Expand All @@ -49,4 +70,5 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.lcov
fail_ci_if_error: true
9 changes: 8 additions & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ jobs:
steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Generate the Cargo.lock file
run: cargo update

- name: Run FOSSA scan and upload build data
uses: fossa-contrib/fossa-action@v1
with:
fossa-api-key: c244cc76fd66ed0dafcb211e621b49dd
fossa-api-key: ${{ secrets.FOSSA_TOKEN }}
skip-test: false
4 changes: 3 additions & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Rebase Pull Requests
uses: linhbn123/rebase-pull-requests@v1.0.1
uses: peter-evans/rebase@v2
with:
base: main
9 changes: 6 additions & 3 deletions .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Build the Documentation
run: |
Expand All @@ -38,4 +42,3 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
keep_files: true
8 changes: 6 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ jobs:
steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
run: cargo
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Perform the security audit
uses: actions-rs/audit-check@v1
Expand Down
7 changes: 5 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ RUN echo "debconf debconf/frontend select Noninteractive" | sudo debconf-set-sel
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" && \
sudo apt-get update -q && \
sudo apt-get install cuda -y --no-install-recommends && \
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && \
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+") && \
rm llvm.sh && \
sudo apt-get clean autoclean && \
sudo apt-get autoremove -y && \
sudo rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked && \
cargo install cargo-reaper --git https://github.com/juntyr/grim-reaper --force --locked
RUN cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force && \
cargo install cargo-reaper --git https://github.com/juntyr/grim-reaper --force
8 changes: 6 additions & 2 deletions src/safety/register_fit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ mod private {
Self::TypeFitsInto64Bits
} else {
#[cfg(not(doc))]
{ Self::TypeExeceeds64Bits(core::any::type_name::<T>()) }
{
Self::TypeExeceeds64Bits(core::any::type_name::<T>())
}
#[cfg(doc)]
{ Self::TypeExeceeds64Bits }
{
Self::TypeExeceeds64Bits
}
}
}
}
Expand Down

0 comments on commit 58b0df7

Please sign in to comment.