From 499b33be2e74ff17c2a40016683642c4835ee55d Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Mon, 11 Mar 2024 16:44:29 +0100 Subject: [PATCH] Install new crun version on debian/ubuntu See: actions/runner-images#9425 --- .github/workflows/composite-action/action.yml | 27 +++++++++++++++++++ .github/workflows/test_cluster.yml | 14 +++------- .github/workflows/test_cluster_mdbf.yml | 13 ++------- .github/workflows/test_default.yml | 13 ++------- .github/workflows/test_mdbf.yml | 13 ++------- 5 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/composite-action/action.yml diff --git a/.github/workflows/composite-action/action.yml b/.github/workflows/composite-action/action.yml new file mode 100644 index 0000000..b1aaa36 --- /dev/null +++ b/.github/workflows/composite-action/action.yml @@ -0,0 +1,27 @@ +--- +name: Setup environment +runs: + using: "composite" + steps: + # See: https://github.com/actions/runner-images/issues/9425 + - name: Patch crun + shell: bash + if: > + startsWith(matrix.distro, 'debian') || + startsWith(matrix.distro, 'ubuntu') + run: | + curl -Lo ./crun https://github.com/containers/crun/releases/download/1.14.4/crun-1.14.4-linux-amd64 + sudo install crun /usr/bin/crun + # This is necessary on GH Actions to allow running systemd in rootless containers + # see: https://github.com/actions/virtual-environments/issues/3536 + # see: https://github.com/ansible-community/molecule/discussions/3155 + - name: Start systemd user service + shell: bash + run: | + loginctl enable-linger $(whoami) + sleep 1 + - name: Install requirements + shell: bash + run: | + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements.txt diff --git a/.github/workflows/test_cluster.yml b/.github/workflows/test_cluster.yml index f3949ca..c909746 100644 --- a/.github/workflows/test_cluster.yml +++ b/.github/workflows/test_cluster.yml @@ -1,6 +1,7 @@ --- name: Cluster + on: push: paths: @@ -48,17 +49,8 @@ jobs: - alpine-3.19 steps: - uses: actions/checkout@v4 - - name: Install requirements - run: | - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt - # This is necessary on GH Actions to allow running systemd in rootless containers - # see: https://github.com/actions/virtual-environments/issues/3536 - # see: https://github.com/ansible-community/molecule/discussions/3155 - - name: Start systemd user service - run: | - loginctl enable-linger $(whoami) - sleep 1 + - name: Setup environment + uses: ./.github/workflows/composite-action - name: Run molecule run: molecule test -s cluster env: diff --git a/.github/workflows/test_cluster_mdbf.yml b/.github/workflows/test_cluster_mdbf.yml index f4a0e63..bd0ed39 100644 --- a/.github/workflows/test_cluster_mdbf.yml +++ b/.github/workflows/test_cluster_mdbf.yml @@ -52,17 +52,8 @@ jobs: mariadb-version: 10.6 steps: - uses: actions/checkout@v4 - - name: Install requirements - run: | - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt - # This is necessary on GH Actions to allow running systemd in rootless containers - # see: https://github.com/actions/virtual-environments/issues/3536 - # see: https://github.com/ansible-community/molecule/discussions/3155 - - name: Start systemd user service - run: | - loginctl enable-linger $(whoami) - sleep 1 + - name: Setup environment + uses: ./.github/workflows/composite-action - name: Run molecule run: molecule test -s cluster env: diff --git a/.github/workflows/test_default.yml b/.github/workflows/test_default.yml index d7d6b13..50a81ab 100644 --- a/.github/workflows/test_default.yml +++ b/.github/workflows/test_default.yml @@ -52,17 +52,8 @@ jobs: - alpine-3.19 steps: - uses: actions/checkout@v4 - - name: Install requirements - run: | - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt - # This is necessary on GH Actions to allow running systemd in rootless containers - # see: https://github.com/actions/virtual-environments/issues/3536 - # see: https://github.com/ansible-community/molecule/discussions/3155 - - name: Start systemd user service - run: | - loginctl enable-linger $(whoami) - sleep 1 + - name: Setup environment + uses: ./.github/workflows/composite-action - name: Run molecule run: molecule test env: diff --git a/.github/workflows/test_mdbf.yml b/.github/workflows/test_mdbf.yml index 233cfbf..c07ab82 100644 --- a/.github/workflows/test_mdbf.yml +++ b/.github/workflows/test_mdbf.yml @@ -93,17 +93,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install requirements - run: | - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt - # This is necessary on GH Actions to allow running systemd in rootless containers - # see: https://github.com/actions/virtual-environments/issues/3536 - # see: https://github.com/ansible-community/molecule/discussions/3155 - - name: Start systemd user service - run: | - loginctl enable-linger $(whoami) - sleep 1 + - name: Setup environment + uses: ./.github/workflows/composite-action - name: Run molecule run: molecule test env: