2023-07-11 17:36:11 +08:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-ko-action:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-05-03 00:50:08 +08:00
|
|
|
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
2023-07-11 17:36:11 +08:00
|
|
|
with:
|
2024-03-28 00:50:09 +08:00
|
|
|
go-version: '1.22'
|
2023-07-11 17:36:11 +08:00
|
|
|
check-latest: 'true'
|
|
|
|
|
2024-05-08 00:55:01 +08:00
|
|
|
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-07-11 17:36:11 +08:00
|
|
|
|
|
|
|
# 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
|