2021-12-02 21:54:29 +08:00
|
|
|
name: make test
|
2020-03-31 23:07:06 +08:00
|
|
|
|
2021-04-07 20:27:58 +08:00
|
|
|
on: [push, pull_request]
|
2020-03-31 23:07:06 +08:00
|
|
|
|
2021-03-22 11:12:33 +08:00
|
|
|
env:
|
|
|
|
CTEST_PARALLEL_LEVEL: "1"
|
2022-01-03 09:47:05 +08:00
|
|
|
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
2021-03-22 11:12:33 +08:00
|
|
|
|
2022-06-05 08:29:28 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-03-31 23:07:06 +08:00
|
|
|
jobs:
|
|
|
|
ubuntu:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-02-01 01:50:57 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-15 06:56:24 +08:00
|
|
|
- name: SetupRust
|
|
|
|
uses: ATiltedTree/setup-rust@v1
|
|
|
|
with:
|
2023-02-21 02:40:47 +08:00
|
|
|
rust-version: 1.67
|
2020-03-31 23:07:06 +08:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
2021-04-25 22:06:03 +08:00
|
|
|
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
|
2020-06-18 23:09:47 +08:00
|
|
|
sudo pip3 install pexpect
|
2021-07-29 23:14:02 +08:00
|
|
|
# Generate a locale that uses a comma as decimal separator.
|
|
|
|
sudo locale-gen fr_FR.UTF-8
|
2020-03-31 23:07:06 +08:00
|
|
|
- name: cmake
|
2020-11-12 00:43:24 +08:00
|
|
|
env:
|
|
|
|
# Some warnings upgraded to errors to match Open Build Service platforms
|
|
|
|
CXXFLAGS: "-Werror=address -Werror=return-type"
|
2020-03-31 23:07:06 +08:00
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
|
|
|
cmake ..
|
|
|
|
- name: make
|
|
|
|
run: |
|
|
|
|
make
|
|
|
|
- name: make test
|
|
|
|
run: |
|
2020-11-07 14:55:47 +08:00
|
|
|
make test
|
2020-03-31 23:07:06 +08:00
|
|
|
|
2022-07-03 09:37:51 +08:00
|
|
|
ubuntu-32bit-fetched-pcre2:
|
2020-11-12 00:43:50 +08:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-02-01 01:50:57 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-15 06:56:24 +08:00
|
|
|
- name: SetupRust
|
|
|
|
uses: ATiltedTree/setup-rust@v1
|
|
|
|
with:
|
2023-02-21 02:40:47 +08:00
|
|
|
rust-version: 1.67
|
2023-01-15 06:56:24 +08:00
|
|
|
targets: "i686-unknown-linux-gnu" # setup-rust wants this space-separated
|
2020-11-12 00:43:50 +08:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
2020-12-20 09:24:11 +08:00
|
|
|
sudo apt update
|
2021-04-25 22:06:03 +08:00
|
|
|
sudo apt install gettext lib32ncurses5-dev python3-pip g++-multilib tmux
|
2020-11-12 00:43:50 +08:00
|
|
|
sudo pip3 install pexpect
|
|
|
|
- name: cmake
|
|
|
|
env:
|
|
|
|
CXXFLAGS: "-m32 -Werror=address -Werror=return-type"
|
|
|
|
CFLAGS: "-m32"
|
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
2023-01-15 06:56:24 +08:00
|
|
|
cmake -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i686-unknown-linux-gnu ..
|
2020-11-12 00:43:50 +08:00
|
|
|
- name: make
|
|
|
|
run: |
|
2023-01-15 06:56:24 +08:00
|
|
|
make VERBOSE=1
|
2020-11-12 00:43:50 +08:00
|
|
|
- name: make test
|
|
|
|
run: |
|
|
|
|
make test
|
|
|
|
|
2020-11-12 00:46:02 +08:00
|
|
|
ubuntu-asan:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
2023-03-07 08:15:36 +08:00
|
|
|
env:
|
|
|
|
# Rust has two different memory sanitizers of interest; they can't be used at the same time:
|
|
|
|
# * AddressSanitizer detects out-of-bound access, use-after-free, use-after-return,
|
|
|
|
# use-after-scope, double-free, invalid-free, and memory leaks.
|
|
|
|
# * MemorySanitizer detects uninitialized reads.
|
|
|
|
#
|
2023-03-13 13:29:54 +08:00
|
|
|
RUSTFLAGS: "-Zsanitizer=address -C link-args=-lasan"
|
2023-03-07 08:15:36 +08:00
|
|
|
# RUSTFLAGS: "-Zsanitizer=memory -Zsanitizer-memory-track-origins"
|
2020-11-12 00:46:02 +08:00
|
|
|
|
|
|
|
steps:
|
2023-02-01 01:50:57 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-15 06:56:24 +08:00
|
|
|
- name: SetupRust
|
|
|
|
uses: ATiltedTree/setup-rust@v1
|
|
|
|
with:
|
2023-03-07 08:15:36 +08:00
|
|
|
# All -Z options require running nightly
|
|
|
|
rust-version: nightly
|
2023-03-08 02:47:30 +08:00
|
|
|
# ASAN uses `cargo build -Zbuild-std` which requires the rust-src component
|
|
|
|
components: rust-src
|
2020-11-12 00:46:02 +08:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
2021-04-25 22:06:03 +08:00
|
|
|
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
|
2020-11-12 00:46:02 +08:00
|
|
|
sudo pip3 install pexpect
|
|
|
|
- name: cmake
|
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
CXX: clang++
|
2022-10-25 04:54:46 +08:00
|
|
|
CXXFLAGS: "-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -DFISH_CI_SAN"
|
2020-11-12 00:46:02 +08:00
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
2023-03-07 08:15:36 +08:00
|
|
|
# Rust's ASAN requires the build system to explicitly pass a --target triple. We read that
|
|
|
|
# value from CMake variable Rust_CARGO_TARGET (shared with corrosion).
|
2023-03-08 02:32:54 +08:00
|
|
|
cmake .. -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu -DCMAKE_BUILD_TYPE=Debug
|
2020-11-12 00:46:02 +08:00
|
|
|
- name: make
|
|
|
|
run: |
|
|
|
|
make
|
2022-10-25 03:06:23 +08:00
|
|
|
- name: make test
|
2022-10-25 04:00:09 +08:00
|
|
|
env:
|
2022-12-03 09:07:15 +08:00
|
|
|
FISH_CI_SAN: 1
|
2022-10-25 04:00:09 +08:00
|
|
|
ASAN_OPTIONS: check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1
|
|
|
|
UBSAN_OPTIONS: print_stacktrace=1:report_error_type=1
|
2022-10-25 03:33:29 +08:00
|
|
|
# use_tls=0 is a workaround for LSAN crashing with "Tracer caught signal 11" (SIGSEGV),
|
|
|
|
# which seems to be an issue with TLS support in newer glibc versions under virtualized
|
|
|
|
# environments. Follow https://github.com/google/sanitizers/issues/1342 and
|
|
|
|
# https://github.com/google/sanitizers/issues/1409 to track this issue.
|
|
|
|
LSAN_OPTIONS: verbosity=0:log_threads=0:use_tls=0
|
2022-10-25 03:06:23 +08:00
|
|
|
run: |
|
|
|
|
make test
|
2020-11-12 00:46:02 +08:00
|
|
|
|
2023-02-19 02:43:56 +08:00
|
|
|
# Our clang++ tsan builds are not recognizing safe rust patterns (such as the fact that Drop
|
|
|
|
# cannot be called while a thread is using the object in question). Rust has its own way of
|
|
|
|
# running TSAN, but for the duration of the port from C++ to Rust, we'll keep this disabled.
|
|
|
|
|
|
|
|
# ubuntu-threadsan:
|
|
|
|
#
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
#
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v3
|
|
|
|
# - name: SetupRust
|
|
|
|
# uses: ATiltedTree/setup-rust@v1
|
|
|
|
# with:
|
2023-02-21 02:40:47 +08:00
|
|
|
# rust-version: 1.67
|
2023-02-19 02:43:56 +08:00
|
|
|
# - name: Install deps
|
|
|
|
# run: |
|
|
|
|
# sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
|
|
|
|
# sudo pip3 install pexpect
|
|
|
|
# - name: cmake
|
|
|
|
# env:
|
|
|
|
# FISH_CI_SAN: 1
|
|
|
|
# CC: clang
|
|
|
|
# CXX: clang++
|
|
|
|
# CXXFLAGS: "-fsanitize=thread"
|
|
|
|
# run: |
|
|
|
|
# mkdir build && cd build
|
|
|
|
# cmake ..
|
|
|
|
# - name: make
|
|
|
|
# run: |
|
|
|
|
# make
|
|
|
|
# - name: make test
|
|
|
|
# run: |
|
|
|
|
# make test
|
2020-11-03 04:04:36 +08:00
|
|
|
|
|
|
|
macos:
|
|
|
|
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
2023-02-01 01:50:57 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-15 06:56:24 +08:00
|
|
|
- name: SetupRust
|
|
|
|
uses: ATiltedTree/setup-rust@v1
|
|
|
|
with:
|
2023-02-21 02:40:47 +08:00
|
|
|
rust-version: 1.67
|
2020-11-03 04:04:36 +08:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
|
|
|
sudo pip3 install pexpect
|
2021-04-25 22:06:03 +08:00
|
|
|
brew install tmux
|
2020-11-03 04:04:36 +08:00
|
|
|
- name: cmake
|
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
|
|
|
cmake -DWITH_GETTEXT=NO ..
|
|
|
|
- name: make
|
|
|
|
run: |
|
|
|
|
make
|
|
|
|
- name: make test
|
|
|
|
run: |
|
|
|
|
make test
|