install without sudo #36
Workflow file for this run
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
name: ci | |
on: | |
pull_request: | |
jobs: | |
test-ko-action: | |
strategy: | |
matrix: | |
runner: | |
- ubuntu-latest | |
- ubuntu-latest-arm | |
runs-on: ${{matrix.runner}} | |
steps: | |
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version: '1.22' | |
check-latest: 'true' | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
# Minimal publish | |
- uses: ./ | |
- run: ko publish --bare ./ | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
KO_DOCKER_REPO: ko.local | |
- name: Install old release | |
uses: ./ | |
with: | |
version: v0.8.0 | |
- name: Check installed version | |
run: ko version | grep 0.8.0 | |
- name: Install from tip | |
uses: ./ | |
with: | |
version: tip | |
- name: Check installed version (tip) | |
run: | | |
sudo rm /usr/local/bin/ko # Uninstall previous versions. | |
ko version | |
# If KO_DOCKER_REPO is set during setup, it's set for future steps. | |
- name: Pre-set KO_DOCKER_REPO | |
uses: ./ | |
env: | |
KO_DOCKER_REPO: already-set | |
- name: Check pre-set KO_DOCKER_REPO | |
run: | | |
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then | |
echo "${KO_DOCKER_REPO} != already-set" | |
exit 1 | |
fi |