-
Notifications
You must be signed in to change notification settings - Fork 304
137 lines (121 loc) · 5.21 KB
/
Copy pathinternal-testsuite.yml
File metadata and controls
137 lines (121 loc) · 5.21 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: c2rust-testsuite
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master, feature/ci-dev ]
pull_request:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
run-testsuite:
strategy:
# ci-c2rust-postprocess.yml generates postprocess caches for this matrix.
# Keep both matrices in sync so this workflow can restore those caches.
matrix:
include:
- runner: ubuntu-latest
os: Linux
arch: x86_64
clang-version: 18
- runner: ubuntu-22.04
os: Linux
arch: x86_64
clang-version: 15
fail-fast: false
name: "run-testsuite (${{ matrix.runner }}: ${{ matrix.os }} ${{ matrix.arch}}, Clang ${{ matrix.clang-version }})"
# The type of runner that the job will run on
runs-on: ${{ matrix.runner }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Working dir is /home/runner/work/c2rust/c2rust
- name: Checkout c2rust
uses: actions/checkout@v2
with:
repository: immunant/c2rust
# `update = none` is set, which makes this not work, so we need to update them manually.
# See `.gitmodules` for more info.
submodules: false
- name: Checkout submodules
run: |
git submodule update --init --checkout tests/integration/tests/curl/repo
git submodule update --init --checkout tests/integration/tests/json-c/repo
git submodule update --init --checkout tests/integration/tests/lua/repo
git submodule update --init --checkout tests/integration/tests/nginx/repo
git submodule update --init --checkout tests/integration/tests/zstd/repo
git submodule update --init --checkout tests/integration/tests/libxml2/repo
git submodule update --init --checkout tests/integration/tests/python2/repo
git submodule update --init --checkout tests/integration/tests/libmcs/repo
- uses: astral-sh/setup-uv@v6
- run: uv python install
- uses: Swatinem/rust-cache@v2
with:
cache-workspace-crates: true
- name: Install Rust toolchains
run: |
rustup toolchain install nightly-2022-11-03 \
--profile minimal --component rustfmt,rustc-dev
rustup toolchain install nightly-2023-04-15 \
--profile minimal --component rustfmt
- name: Provision Debian Packages
run: |
sudo apt-get -qq update
sudo apt-get -qq install \
bear \
build-essential \
libbrotli-dev \
libbz2-dev \
libclang-${{ matrix.clang-version }}-dev \
libdb-dev \
libgcrypt20 \
libgdbm-dev \
libreadline-dev \
libidn2-dev \
libldap2-dev \
liblzma-dev \
libnghttp2-dev \
libpcre3-dev \
libpsl-dev \
librtmp-dev \
libtool \
libzstd-dev \
rcs \
tcl-dev \
tk-dev \
zlib1g-dev
# Runs a single command using the runners shell
# Working dir is /home/runner/work/c2rust/c2rust
- name: Build c2rust
run: |
export LLVM_CONFIG_PATH=/usr/bin/llvm-config-${{ matrix.clang-version }}
cargo build --release
- name: Build tools
run: |
# `cd tools` to pick up `tools/rust-toolchain.toml` (stable, for `edition = "2024"`)
(cd tools && cargo build --release --manifest-path split_rust/Cargo.toml)
(cd tools && cargo build --release --manifest-path merge_rust/Cargo.toml)
- name: Restore postprocess cache
uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/llm-cache
# Restore the newest available cache entry that matches this prefix.
key: postprocess-cache-${{ matrix.runner }}-${{ matrix.arch }}-clang-${{ matrix.clang-version }}-
- name: Run c2rust testsuite
env:
# Uses cache-only responses; skips uncached work and exercises cached
# postprocess output usage.
C2RUST_POSTPROCESS_EXTRA_ARGS: --on-error warn --cache-dir ${{ runner.temp }}/llm-cache
run: |
export PATH=$PWD/target/release:$PWD/c2rust-postprocess:$HOME/.local/bin:$PATH
echo "PATH=$PATH"
export C2RUST_DIR=$PWD
./tests/integration/test.py curl json-c lua nginx zstd libxml2 python2 libmcs
- uses: actions/upload-artifact@v4
with:
name: testsuite-${{ matrix.runner }}-artifacts
path: |
${{ github.workspace }}/tests/integration/**/*.log
${{ github.workspace }}/tests/integration/**/compile_commands.json
${{ github.workspace }}/tests/integration/tests/refactor-diffs/**
if: always()