Skip to content

Commit 58b0df7

Browse files
committed
Update the CI actions and use the new linker with llvm-link
1 parent 4761d5c commit 58b0df7

File tree

8 files changed

+144
-39
lines changed

8 files changed

+144
-39
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,39 @@ on:
77
pull_request:
88
branches:
99
- '*'
10-
# Stop scheduled CI until const traits are back
11-
# schedule:
12-
# - cron: '0 0 * * MON'
10+
schedule:
11+
- cron: '0 0 * * MON'
1312

1413
env:
1514
CARGO_TERM_COLOR: always
1615

1716
jobs:
1817
check:
1918
name: Check
20-
runs-on: ubuntu-latest
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest]
23+
rust: [nightly]
24+
2125
steps:
2226
- name: Checkout the Repository
2327
uses: actions/checkout@v2
24-
28+
2529
- name: Install the Rust toolchain
26-
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
30+
uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: ${{ matrix.rust }}
33+
profile: minimal
34+
target: nvptx64-nvidia-cuda
35+
override: true
36+
37+
- name: Install the rust-ptx-linker
38+
run: |
39+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
40+
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
41+
rm llvm.sh
42+
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
2743
2844
- name: Check without features on CPU
2945
run: |
@@ -74,11 +90,13 @@ jobs:
7490
7591
test:
7692
name: Test Suite
77-
runs-on: ubuntu-latest
78-
steps:
79-
- name: Checkout the Repository
80-
uses: actions/checkout@v2
93+
runs-on: ${{ matrix.os }}
94+
strategy:
95+
matrix:
96+
os: [ubuntu-latest]
97+
rust: [nightly]
8198

99+
steps:
82100
- name: Install CUDA
83101
run: |
84102
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
@@ -89,8 +107,23 @@ jobs:
89107
sudo apt-get update -q
90108
sudo apt-get install cuda -y --no-install-recommends
91109
110+
- name: Checkout the Repository
111+
uses: actions/checkout@v2
112+
92113
- name: Install the Rust toolchain
93-
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
114+
uses: actions-rs/toolchain@v1
115+
with:
116+
toolchain: ${{ matrix.rust }}
117+
profile: minimal
118+
target: nvptx64-nvidia-cuda
119+
override: true
120+
121+
- name: Install the rust-ptx-linker
122+
run: |
123+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
124+
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
125+
rm llvm.sh
126+
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
94127
95128
- name: Run the test-suite
96129
run: |
@@ -99,22 +132,49 @@ jobs:
99132
fmt:
100133
name: Rustfmt
101134
runs-on: ubuntu-latest
135+
102136
steps:
103137
- name: Checkout the Repository
104138
uses: actions/checkout@v2
105139

140+
- name: Install the Rust toolchain
141+
uses: actions-rs/toolchain@v1
142+
with:
143+
toolchain: nightly
144+
profile: minimal
145+
components: rustfmt
146+
override: true
147+
106148
- name: Check the code formatting
107149
run: cargo fmt --all -- --check
108150

109151
clippy:
110152
name: Clippy
111-
runs-on: ubuntu-latest
153+
runs-on: ${{ matrix.os }}
154+
strategy:
155+
matrix:
156+
os: [ubuntu-latest]
157+
rust: [nightly]
158+
112159
steps:
113160
- name: Checkout the Repository
114161
uses: actions/checkout@v2
115-
162+
116163
- name: Install the Rust toolchain
117-
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
164+
uses: actions-rs/toolchain@v1
165+
with:
166+
toolchain: ${{ matrix.rust }}
167+
profile: minimal
168+
components: clippy
169+
target: nvptx64-nvidia-cuda
170+
override: true
171+
172+
- name: Install the rust-ptx-linker
173+
run: |
174+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
175+
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
176+
rm llvm.sh
177+
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
118178
119179
- name: Check the code style without features on CPU
120180
run: |

.github/workflows/coverage.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
name: Code Coverage
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout the Repository
14-
uses: actions/checkout@v2
15-
1613
- name: Install CUDA
1714
run: |
1815
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
@@ -22,21 +19,45 @@ jobs:
2219
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
2320
sudo apt-get update -q
2421
sudo apt-get install cuda -y --no-install-recommends
22+
23+
- name: Download grcov
24+
run: |
25+
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
26+
chmod +x ./grcov
27+
28+
- name: Checkout the Repository
29+
uses: actions/checkout@v2
2530

2631
- name: Install the Rust toolchain
27-
run: |
28-
cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
29-
cargo install grcov --force --locked
30-
rustup component add llvm-tools-preview
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: nightly
35+
profile: minimal
36+
components: llvm-tools-preview
37+
target: nvptx64-nvidia-cuda
38+
override: true
3139

32-
- name: Generate the code coverage
40+
- name: Install the rust-ptx-linker
3341
run: |
34-
RUSTFLAGS="-Cinstrument-coverage" \
35-
LLVM_PROFILE_FILE="codecov-%p-%m.profraw" \
36-
cargo test --workspace
37-
38-
grcov . -s . --binary-path ./target/debug/ \
39-
-t cobertura -o cobertura.xml --branch \
42+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
43+
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
44+
rm llvm.sh
45+
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
46+
47+
- name: Generate the coverage data
48+
run: |
49+
cargo clean
50+
cargo test --workspace --all-targets
51+
env:
52+
CARGO_INCREMENTAL: 0
53+
RUSTFLAGS: -Cinstrument-coverage
54+
RUSTDOCFLAGS: -Cinstrument-coverage
55+
LLVM_PROFILE_FILE: coverage/coverage-%p-%m.profraw
56+
57+
- name: Generate the coverage reports
58+
run: |
59+
./grcov . -s . --binary-path ./target/debug/deps \
60+
-t lcov -o coverage.lcov --branch \
4061
--keep-only "src/*" \
4162
--keep-only "rust-cuda-ptx-jit/*" \
4263
--keep-only "rust-cuda-derive/*" \
@@ -49,4 +70,5 @@ jobs:
4970
uses: codecov/codecov-action@v1
5071
with:
5172
token: ${{ secrets.CODECOV_TOKEN }}
73+
files: coverage.lcov
5274
fail_ci_if_error: true

.github/workflows/fossa.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ jobs:
1717
steps:
1818
- name: Checkout the Repository
1919
uses: actions/checkout@v2
20+
21+
- name: Install the Rust toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: nightly
25+
profile: minimal
26+
override: true
2027

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

2431
- name: Run FOSSA scan and upload build data
2532
uses: fossa-contrib/fossa-action@v1
2633
with:
27-
fossa-api-key: c244cc76fd66ed0dafcb211e621b49dd
34+
fossa-api-key: ${{ secrets.FOSSA_TOKEN }}
2835
skip-test: false

.github/workflows/rebase.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Rebase Pull Requests
13-
uses: linhbn123/[email protected]
13+
uses: peter-evans/rebase@v2
14+
with:
15+
base: main

.github/workflows/rustdoc.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ jobs:
1616
steps:
1717
- name: Checkout the Repository
1818
uses: actions/checkout@v2
19-
19+
2020
- name: Install the Rust toolchain
21-
run: cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: nightly
24+
profile: minimal
25+
override: true
2226

2327
- name: Build the Documentation
2428
run: |
@@ -38,4 +42,3 @@ jobs:
3842
github_token: ${{ secrets.GITHUB_TOKEN }}
3943
publish_branch: gh-pages
4044
publish_dir: ./target/doc
41-
keep_files: true

.github/workflows/security.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ jobs:
1313
steps:
1414
- name: Checkout the Repository
1515
uses: actions/checkout@v2
16-
16+
1717
- name: Install the Rust toolchain
18-
run: cargo
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: nightly
21+
profile: minimal
22+
override: true
1923

2024
- name: Perform the security audit
2125
uses: actions-rs/audit-check@v1

.gitpod.Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ RUN echo "debconf debconf/frontend select Noninteractive" | sudo debconf-set-sel
1414
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" && \
1515
sudo apt-get update -q && \
1616
sudo apt-get install cuda -y --no-install-recommends && \
17+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && \
18+
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+") && \
19+
rm llvm.sh && \
1720
sudo apt-get clean autoclean && \
1821
sudo apt-get autoremove -y && \
1922
sudo rm -rf /var/lib/{apt,dpkg,cache,log}/
2023

21-
RUN cargo install ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force --locked && \
22-
cargo install cargo-reaper --git https://github.com/juntyr/grim-reaper --force --locked
24+
RUN cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force && \
25+
cargo install cargo-reaper --git https://github.com/juntyr/grim-reaper --force

src/safety/register_fit.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ mod private {
2424
Self::TypeFitsInto64Bits
2525
} else {
2626
#[cfg(not(doc))]
27-
{ Self::TypeExeceeds64Bits(core::any::type_name::<T>()) }
27+
{
28+
Self::TypeExeceeds64Bits(core::any::type_name::<T>())
29+
}
2830
#[cfg(doc)]
29-
{ Self::TypeExeceeds64Bits }
31+
{
32+
Self::TypeExeceeds64Bits
33+
}
3034
}
3135
}
3236
}

0 commit comments

Comments
 (0)