Skip to content

transpile: Split off enums module #3797

transpile: Split off enums module

transpile: Split off enums module #3797

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:
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
submodules: true
- 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-08-08 \
--profile minimal --component rustfmt,rustc-dev
rustup toolchain install nightly-2023-04-15 \
--profile minimal --component rustfmt
# TODO(pl): Figure out why json-c fails when caching compile commands
# - name: Get Image Version
# id: get-image-ver
# run: |
# echo "::set-output name=version::$(echo $ImageVersion)"
# shell: bash
# - name: Cache testsuite compile_commands
# uses: actions/cache@v4
# with:
# path: |
# ${{ github.workspace }}/tests/integration/tests/**/compile_commands.json
# key: ${{ runner.os }}-ccdb-${{ steps.get-image-ver.outputs.version }}
- name: Provision Debian Packages
run: |
sudo apt-get -qq update
sudo apt-get -qq install \
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
# TODO(pl): figure out why compile_commands.json may cause json-c to fail
- name: Run c2rust testsuite
run: |
find tests/integration -type f -name compile_commands.json -delete
export PATH=$PWD/target/release:$HOME/.local/bin:$PATH
echo "PATH=$PATH"
export C2RUST_DIR=$PWD
# Needs to be run from `tests/integration/` (or further inside)
# to correctly load the `pyproject.toml`.
(cd 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()