Skip to content

Commit f5b0ecf

Browse files
davidtwcoDavid Wood
authored andcommitted
run testing in ci
Run the new test suite in GitHub Actions. Signed-off-by: David Wood <[email protected]>
1 parent 4438b4b commit f5b0ecf

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,9 @@ on: [push, pull_request]
33
name: continuous integration
44

55
jobs:
6-
build:
7-
name: build
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions-rs/toolchain@v1
12-
with:
13-
profile: minimal
14-
toolchain: stable
15-
override: true
16-
- uses: actions-rs/cargo@v1
17-
with:
18-
command: build
19-
206
test:
217
name: test
22-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-20.04
239
steps:
2410
- uses: actions/checkout@v2
2511
- uses: actions-rs/toolchain@v1
@@ -29,19 +15,31 @@ jobs:
2915
override: true
3016
- uses: actions-rs/cargo@v1
3117
with:
32-
command: test
18+
command: build
19+
args: --release
20+
- name: Install LLVM
21+
run: |
22+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
23+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
24+
sudo apt-get update
25+
sudo apt-get install --no-install-recommends --yes llvm-13 llvm-13-tools
26+
- name: Install lit
27+
run: pip install lit
28+
- name: Run lit testsuite
29+
run: lit -v --path "$PWD/target/release/:/usr/lib/llvm-13/bin/" ./tests
3330

3431
fmt:
3532
name: rustfmt
36-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-20.04
3734
steps:
3835
- uses: actions/checkout@v2
3936
- uses: actions-rs/toolchain@v1
4037
with:
4138
profile: minimal
4239
toolchain: stable
4340
override: true
44-
- run: rustup component add rustfmt
41+
- name: Add rustup component
42+
run: rustup component add rustfmt
4543
- uses: actions-rs/cargo@v1
4644
with:
4745
command: fmt

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@ $ cargo build
4242
To run the tests, first install the relevant dependencies:
4343

4444
```shell-session
45+
$ apt install --no-install-recommends --yes llvm-13 llvm-13-tools
4546
$ pip install lit
46-
$ wget clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz -O llvm.tar.xz # (you might want to update or change architecture)
47-
$ tar xvf llvm.tar.xz
4847
```
4948

50-
Next, run the `lit` testsuite, replacing `$LLVM` with the path to the extracted LLVM.
49+
Next, run the `lit` testsuite (replacing `/path/to/llvm/bin` with the correct path to your LLVM
50+
installation, if required):
5151

5252
```shell-session
53-
$ cargo build
54-
$ lit -v --path $PWD/target/debug/ --path $LLVM/build/bin/ ./tests
53+
$ cargo build # in debug mode..
54+
$ lit -v --path "$PWD/target/debug/:/path/to/llvm/bin/" ./tests
55+
$ cargo build --release # ..or in release mode
56+
$ lit -v --path "$PWD/target/release/:/path/to/llvm/bin/" ./tests
5557
```
5658

5759
We use `rustfmt` to automatically format and style all of our code. To install and use `rustfmt`:

0 commit comments

Comments
 (0)