From c45535fd9a944a3046b2e04f15296d886f18576a Mon Sep 17 00:00:00 2001 From: Marco Kellershoff Date: Sat, 7 Sep 2024 11:39:52 +0200 Subject: [PATCH] try custom image for tests --- .github/workflows/tests.yml | 11 ++++++----- Dockerfile | 6 ++++++ scripts/tests.sh | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c1baf4..4c48527 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,11 +10,14 @@ jobs: tests: name: Tests runs-on: ${{ matrix.os }} + container: + image: ${{ matrix.container }} strategy: fail-fast: false matrix: include: - - os: ubuntu-22.04 + - os: ubuntu-latest + container: gorillamoe/ubuntu-with-libfuse2:latest rev: v0.10.0/nvim.appimage steps: - uses: actions/checkout@v4 @@ -24,12 +27,10 @@ jobs: path: | _neovim ~/.local/share/nvim/site/pack/vendor/start - key: ${{ runner.os }}-${{ matrix.rev }} + key: ${{ runner.os }}-${{ matrix.container }}-${{ matrix.rev }} - name: Prepare dependencies - run: | # TODO: Cache apt dependencies - sudo apt-get update && sudo apt-get install -y libfuse2 - ./scripts/tests.sh prepare ${{ matrix.rev }} + run: ./scripts/tests.sh prepare ${{ matrix.rev }} - name: Run tests run: ./scripts/tests.sh run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b1bd313 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +# Used for running tests in CI +FROM ubuntu:latest + +RUN apt-get update && apt-get upgrade -y && apt-get install -y libfuse2 curl git kmod linux-generic +RUN depmod -a +RUN modprobe fuse diff --git a/scripts/tests.sh b/scripts/tests.sh index d1589e7..200aa27 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -7,7 +7,7 @@ NVIM_DL_BASE="https://github.com/neovim/neovim/releases/download/" prepare() { local version=$1 - + modprobe fuse if [[ ! -f _neovim/nvim ]] && [[ -n $version ]]; then mkdir -p _neovim && curl -sL -o _neovim/nvim "${NVIM_DL_BASE}${version}" && chmod +x _neovim/nvim _neovim/nvim --headless -c 'TSInstallSync lua | quit'