-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (50 loc) · 1.8 KB
/
rcalc-test.yml
File metadata and controls
53 lines (50 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Rcalc Test
on:
push:
branches: [main]
pull_request:
merge_group:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
LLVM_VERSION: 18.1
jobs:
test-rcalc:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt update && sudo apt install -y libtinfo5
- name: Update rust toolchain
run: rustup update
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ env.LLVM_VERSION }}
- name: Run llvm-config
run: llvm-config --version --bindir --libdir
- name: Cache cargo build
uses: actions/cache@v5
id: cargo-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ env.LLVM_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo build --features="jit" --release --verbose
- name: Run tests
run: cargo test --features="jit" --release --verbose
- name: E2E tests
run: |
[[ `cargo run --release --features="jit" -- -a=1 -b=-2 "a + b" --jit --pure` == "-1" ]]
[[ `cargo run --release -- -a=1 -b=-2 "a + b" --pure` == "-1" ]]
[[ `cargo run --release --features="jit" -- -a=1000 -b=7890 "a * b" --jit --pure` == "7890000" ]]
[[ `cargo run --release -- -a=1000 -b=7890 "a * b" --pure` == "7890000" ]]
[[ `cargo run --release --features="jit" -- -a=1000 -b=7890 "add(a, b)" --jit --pure` == "8890" ]]
[[ `cargo run --release -- -a=1000 -b=7890 "add(a, b)" --pure` == "8890" ]]