From 8ddadd28b9a9ce91ae0436f53047bed25e52288f Mon Sep 17 00:00:00 2001 From: Bram De Coninck Date: Wed, 11 Sep 2024 17:37:22 +0200 Subject: [PATCH] Get rid of duplicate code --- .../actions/prepare_ubuntu_runner/action.yaml | 23 +++++++++++++++++++ ...ult-workflow.yml => default-workflow.yaml} | 0 .github/workflows/release-workflow.yaml | 17 ++------------ 3 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 .github/actions/prepare_ubuntu_runner/action.yaml rename .github/workflows/{default-workflow.yml => default-workflow.yaml} (100%) diff --git a/.github/actions/prepare_ubuntu_runner/action.yaml b/.github/actions/prepare_ubuntu_runner/action.yaml new file mode 100644 index 0000000..d7100d9 --- /dev/null +++ b/.github/actions/prepare_ubuntu_runner/action.yaml @@ -0,0 +1,23 @@ +name: "Prepare Ubuntu runner" +description: "Prepare Ubuntu runner" +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change + + - name: Install gems + shell: bash + run: bundle install + + - name: Install FVM + shell: bash + run: curl -fsSL https://fvm.app/install.sh | bash + + - name: Set up FVM + shell: bash + run: fvm use diff --git a/.github/workflows/default-workflow.yml b/.github/workflows/default-workflow.yaml similarity index 100% rename from .github/workflows/default-workflow.yml rename to .github/workflows/default-workflow.yaml diff --git a/.github/workflows/release-workflow.yaml b/.github/workflows/release-workflow.yaml index c307356..ea20401 100644 --- a/.github/workflows/release-workflow.yaml +++ b/.github/workflows/release-workflow.yaml @@ -10,21 +10,8 @@ jobs: name: Run tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change - - - name: Install gems - run: bundle install - - - name: Install FVM - run: curl -fsSL https://fvm.app/install.sh | bash - - - name: Set up FVM - run: fvm use + - uses: ./actions/.github/actions/prepare_ubuntu_runner + id: prepare_ubuntu_runner - name: Run virtual machine tests run: bundle exec fastlane run_vm_tests