diff --git a/.github/actions/install-swift/action.yml b/.github/actions/install-swift/action.yml index 802d740..1f16de9 100644 --- a/.github/actions/install-swift/action.yml +++ b/.github/actions/install-swift/action.yml @@ -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 }} diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 195a6cc..a1f755f 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -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: >