diff options
| author | 卜部昌平 <shyouhei@ruby-lang.org> | 2023-06-29 17:02:49 +0900 |
|---|---|---|
| committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2023-06-30 17:39:39 +0900 |
| commit | 34bf2d508585799fc6fd272750a1c053f38e06cf (patch) | |
| tree | e87405bd5d2bd6dac2804bdd37f9b2a958d9d578 | |
| parent | e8d629ed76cab8b17f82f024b6b5f7eddb71ab51 (diff) | |
refactor extract brew
Use composite action to reduce copy & paste.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8005
| -rw-r--r-- | .github/actions/setup/macos/action.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/check_dependencies.yml | 7 | ||||
| -rw-r--r-- | .github/workflows/macos.yml | 5 |
3 files changed, 20 insertions, 9 deletions
diff --git a/.github/actions/setup/macos/action.yml b/.github/actions/setup/macos/action.yml new file mode 100644 index 0000000000..fa3137f8fc --- /dev/null +++ b/.github/actions/setup/macos/action.yml @@ -0,0 +1,17 @@ +name: Setup macOS environment +description: >- + Installs necessary packages via Homebrew. + +inputs: {} # nothing? + +outputs: {} # nothing? + +runs: + using: composite + + steps: + - name: brew + shell: bash + run: | + brew upgrade + brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
\ No newline at end of file diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml index a24c649361..d55846b2bc 100644 --- a/.github/workflows/check_dependencies.yml +++ b/.github/workflows/check_dependencies.yml @@ -38,11 +38,6 @@ jobs: runs-on: ${{ matrix.os }} if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} steps: - - name: Install libraries - run: | - brew upgrade - brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline - if: ${{ contains(matrix.os, 'macos') }} - name: git config run: | git config --global advice.detachedHead 0 @@ -50,6 +45,8 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - uses: ./.github/actions/setup/ubuntu if: ${{ contains(matrix.os, 'ubuntu') }} + - uses: ./.github/actions/setup/macos + if: ${{ contains(matrix.os, 'macos') }} - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: .downloaded-cache diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b35551a1be..bb2c571c89 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -57,10 +57,7 @@ jobs: path: src/.downloaded-cache key: downloaded-cache - name: Install libraries - run: | - brew upgrade - brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline - working-directory: src + uses: ./src/.github/actions/setup/macos - name: Set ENV run: | echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV |
