From 50dfd962ecbd227bf99dce04a466817f7152c6ca Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 10 Oct 2025 21:17:32 +0200 Subject: [PATCH] Document system test dependencies Notably, the parent commit adds wget. While at it, extract a reusable action. --- .../actions/install-dependencies/action.yml | 43 +++++++++++++ .github/workflows/test.yml | 60 +++++-------------- README.rst | 2 +- 3 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 .github/actions/install-dependencies/action.yml diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml new file mode 100644 index 000000000..3ecfc156e --- /dev/null +++ b/.github/actions/install-dependencies/action.yml @@ -0,0 +1,43 @@ +name: Install dependencies for system tests + +inputs: + include_sphinx: + description: Whether to install Sphinx + required: true + default: false + include_pcre: + description: Whether to install the PCRE library + required: false + default: true + +permissions: + contents: read + +runs: + using: "composite" + steps: + - shell: bash + env: + include_sphinx: ${{ inputs.include_sphinx }} + include_pcre: ${{ inputs.include_pcre }} + run: | + set -x + : "optional dependencies" + sudo apt install \ + gettext \ + $(if $include_pcre; then echo libpcre2-dev; fi) \ + $(if $include_sphinx; then echo python3-sphinx; fi) \ + ; + : "system test dependencies" + sudo apt install \ + diffutils $(: "for diff") \ + git \ + gettext \ + less \ + $(if ${{ inputs.include_pcre }}; then echo libpcre2-dev; fi) \ + python3-pexpect \ + tmux \ + wget \ + ; + - uses: ./.github/actions/install-sphinx-markdown-builder + if: ${{ inputs.include_sphinx == 'true' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a0b645b5..3813f95e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,18 +11,17 @@ permissions: jobs: ubuntu: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - uses: ./.github/actions/rust-toolchain@oldest-supported - name: Install deps + uses: ./.github/actions/install-dependencies + with: + include_sphinx: true + - name: Generate a locale that uses a comma as decimal separator. run: | - sudo apt install gettext libpcre2-dev python3-pexpect python3-sphinx tmux - # Generate a locale that uses a comma as decimal separator. sudo locale-gen fr_FR.UTF-8 - - uses: ./.github/actions/install-sphinx-markdown-builder - name: cmake run: | mkdir build && cd build @@ -43,18 +42,20 @@ jobs: git --no-pager diff --exit-code || { echo 'There are uncommitted changes after regenerating the gettext PO files. Make sure to update them via `build_tools/update_translations.fish` after changing source files.'; exit 1; } ubuntu-32bit-static-pcre2: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - uses: ./.github/actions/rust-toolchain@oldest-supported with: - targets: "i586-unknown-linux-gnu" # rust-toolchain wants this comma-separated + targets: "i586-unknown-linux-gnu" - name: Install deps + uses: ./.github/actions/install-dependencies + with: + include_pcre: false + include_sphinx: false + - name: Install g++-multilib run: | - sudo apt update - sudo apt install gettext python3-pexpect g++-multilib tmux + sudo apt install g++-multilib - name: cmake env: CFLAGS: "-m32" @@ -69,7 +70,6 @@ jobs: make -C build VERBOSE=1 fish_run_tests ubuntu-asan: - runs-on: ubuntu-latest env: # Rust has two different memory sanitizers of interest; they can't be used at the same time: @@ -79,7 +79,6 @@ jobs: # RUSTFLAGS: "-Zsanitizer=address" # RUSTFLAGS: "-Zsanitizer=memory -Zsanitizer-memory-track-origins" - steps: - uses: actions/checkout@v4 # All -Z options require running nightly @@ -89,8 +88,11 @@ jobs: # this is comma-separated components: rust-src - name: Install deps + uses: ./.github/actions/install-dependencies + with: + include_sphinx: false + - name: Install llvm run: | - sudo apt install gettext libpcre2-dev python3-pexpect tmux sudo apt install llvm # for llvm-symbolizer - name: cmake env: @@ -119,38 +121,8 @@ jobs: export LSAN_OPTIONS="$LSAN_OPTIONS:suppressions=$PWD/build_tools/lsan_suppressions.txt" make -C build VERBOSE=1 fish_run_tests - # 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@v4 - # - uses: ./.github/actions/rust-toolchain@oldest-supported - # - name: Install deps - # run: | - # sudo apt install gettext libpcre2-dev python3-pexpect tmux - # - name: cmake - # env: - # FISH_CI_SAN: 1 - # CC: clang - # run: | - # mkdir build && cd build - # cmake .. - # - name: make - # run: | - # make - # - name: make fish_run_tests - # run: | - # make -C build fish_run_tests - macos: - runs-on: macos-latest - env: # macOS runners keep having issues loading Cargo.toml dependencies from git (GitHub) instead # of crates.io, so give this a try. It's also sometimes significantly faster on all platforms. @@ -176,9 +148,7 @@ jobs: make -C build VERBOSE=1 fish_run_tests windows: - runs-on: windows-latest - defaults: run: shell: msys2 {0} diff --git a/README.rst b/README.rst index a0a33b7b8..05216ba66 100644 --- a/README.rst +++ b/README.rst @@ -128,7 +128,7 @@ Compiling fish requires: Sphinx is also optionally required to build the documentation from a cloned git repository. -Additionally, running the full test suite requires Python 3.5+, tmux, and the pexpect package. +Additionally, running the full test suite requires diff, git, Python 3.5+, pexpect, less, tmux and wget. Building from source with CMake ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~