Skip to content

Commit

Permalink
Make callable installer workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iainelder committed Jul 1, 2024
1 parent 3ebdc30 commit 1ec070c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/test_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,6 @@ jobs:
name: Test installers
needs: list_installers
if: needs.list_installers.outputs.installers != '[]'
runs-on: ubuntu-latest
container:
image: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
installer: ${{ fromJson(needs.list_installers.outputs.installers) }}
os: ["ubuntu:20.04", "ubuntu:22.04"]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Prepare Docker
run: ./scripts/prepare_docker.bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install ${{matrix.installer}}
shell: su norm --command "bash --login {0}"
run: programs/${{matrix.installer}}/install.bash

- name: Install ${{matrix.installer}} again (test idempotency)
shell: su norm --command "bash --login {0}"
run: programs/${{matrix.installer}}/install.bash
uses: ./.github/workflows/test_installers.yml
with:
installers: ${{needs.list_installers.outputs.installers}}
35 changes: 35 additions & 0 deletions .github/workflows/test_installers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test installers
on:
workflow_call:
inputs:
installers:
description: A JSON list of install names
required: true
type: string

test_installers:
name: Test installers
runs-on: ubuntu-latest
container:
image: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
installer: ${{ fromJson(inputs.installers) }}
os: ["ubuntu:20.04", "ubuntu:22.04"]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Prepare Docker
run: ./scripts/prepare_docker.bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install ${{matrix.installer}}
shell: su norm --command "bash --login {0}"
run: programs/${{matrix.installer}}/install.bash

- name: Install ${{matrix.installer}} again (test idempotency)
shell: su norm --command "bash --login {0}"
run: programs/${{matrix.installer}}/install.bash

0 comments on commit 1ec070c

Please sign in to comment.