-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test.yml: separate the job for building
lima
from the matrix test j…
…obs to avoid duplicate builds under the same conditions. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
- Loading branch information
1 parent
c82e6ce
commit fcbb5a7
Showing
3 changed files
with
110 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: install lima from artifact | ||
description: install lima from artifact | ||
inputs: | ||
artifact: | ||
description: artifact to install | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact }} | ||
path: _artifacts | ||
- name: Install lima from downloaded archive on Linux | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo make uninstall | ||
sudo tar -C /usr/local -xvf _artifacts/${{ inputs.artifact }} --no-same-owner | ||
shell: bash | ||
- name: Install lima from downloaded archive on macOS | ||
if: runner.os == 'macOS' | ||
run: | | ||
make uninstall || true | ||
tar -C /usr/local -xvmf _artifacts/${{ inputs.artifact }} --no-same-owner | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: build lima | ||
run-name: build lima on ${{ inputs.runs-on }} using go ${{ inputs.go-version }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
go-version: | ||
type: string | ||
description: 'The version of Go to use' | ||
required: false | ||
default: '1.22.x' | ||
runs-on: | ||
type: string | ||
description: 'The type of runner to use' | ||
required: true | ||
outputs: | ||
artifact: | ||
description: 'The name of the artifact' | ||
value: ${{ jobs.build.outputs.artifact }} | ||
|
||
jobs: | ||
build: | ||
name: "Build on ${{ inputs.runs-on }} using go ${{ inputs.go-version }}" | ||
runs-on: ${{ inputs.runs-on }} | ||
timeout-minutes: 30 | ||
outputs: | ||
artifact: ${{ steps.set-output.outputs.artifact }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
- name: Make | ||
run: make | ||
- name: Make install on Linux | ||
if: runner.os == 'Linux' | ||
run: sudo make install | ||
- name: Make install on macOS | ||
if: runner.os == 'macOS' | ||
run: make install | ||
- name: set output | ||
id: set-output | ||
run: echo "artifact=lima-${{ inputs.runs-on }}.tar.gz" >> $GITHUB_OUTPUT | ||
- name: create archive | ||
run: | | ||
mkdir -p _artifacts | ||
tar -C _output/ -czvf _artifacts/${{ steps.set-output.outputs.artifact }} ./ | ||
- name: upload archive | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.set-output.outputs.artifact }} | ||
path: _artifacts/${{ steps.set-output.outputs.artifact }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters