use Action inputs

This commit is contained in:
omochimetaru 2024-05-19 15:00:40 +09:00 committed by Yuta Saito
parent c6494d8b03
commit 147c022f8c
2 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,13 @@
runs:
using: composite
inputs:
swift-dir:
description: The directory name part of the distribution URL
required: true
swift-version:
description: Git tag indicating the Swift version
required: true
steps:
# https://www.swift.org/install/linux/#installation-via-tarball
- name: Install dependent packages for Swift
@ -27,10 +35,10 @@ runs:
- name: Download Swift
shell: bash
run: curl -fLO https://download.swift.org/${{ env.SWIFT_DIR }}/${{ env.SWIFT_VERSION }}/${{ env.SWIFT_VERSION }}-ubuntu22.04.tar.gz
run: curl -fLO https://download.swift.org/${{ inputs.swift-dir }}/${{ inputs.swift-version }}/${{ inputs.swift-version }}-ubuntu22.04.tar.gz
working-directory: ${{ env.RUNNER_TEMP }}
- name: Unarchive and Install Swift
shell: bash
run: sudo tar -xf ${{ env.SWIFT_VERSION }}-ubuntu22.04.tar.gz --strip-components=2 -C /usr/local
run: sudo tar -xf ${{ inputs.swift-version }}-ubuntu22.04.tar.gz --strip-components=2 -C /usr/local
working-directory: ${{ env.RUNNER_TEMP }}

View File

@ -45,9 +45,6 @@ jobs:
name: Build and test on Linux with Swift ${{ matrix.swift.version }}
timeout-minutes: 40
runs-on: ubuntu-22.04
env:
SWIFT_DIR: ${{ matrix.swift.dir }}
SWIFT_VERSION: ${{ matrix.swift.version }}
strategy:
matrix:
include:
@ -59,6 +56,9 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-swift
with:
swift-dir: ${{ matrix.swift.dir }}
swift-version: ${{ matrix.swift.version }}
- name: Install dependent packages for Wasm
run: >