implementing version checks
Some checks failed
test / test (push) Has been cancelled

This commit is contained in:
jake 2025-05-21 23:35:35 -04:00
parent 09214e49b9
commit f2ffed2be3
3 changed files with 10 additions and 7 deletions

View File

@ -2,12 +2,10 @@ name: "test"
run-name: "test" run-name: "test"
on: on:
push: push:
branches:
- master
jobs: jobs:
test: test:
runs-on: [smoketest] runs-on: fire
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -19,9 +17,8 @@ jobs:
- name: "run go install script" - name: "run go install script"
shell: bash shell: bash
env: env:
GO_INSTALL_COMMANDS: github.com/jake-young-dev/kelp@v0.0.9 GO_INSTALL_COMMANDS: code.jakeyoungdev.com/jake/mctl@v0.3.4
GO_INSTALL_ARCH: amd64 GO_INSTALL_ARCH: amd64
GO_INSTALL_PURGE: no
run: | run: |
chmod +x install.sh chmod +x install.sh
./install.sh ./install.sh
@ -32,4 +29,4 @@ jobs:
- name: "check go installed command" - name: "check go installed command"
shell: bash shell: bash
run: kelp -v | grep "kelp version v0.0.9" run: mctl -v | grep "mctl version v0.3.4"

View File

@ -3,7 +3,7 @@ description: "simple and fast install for golang and golang commands on linux wo
inputs: inputs:
arch: arch:
description: "Optional, the linux architecture to use when downloading Go files (default: amd64)" description: "Optional, the linux architecture to use when downloading Go files (default: amd64)"
required: true required: false
default: "amd64" default: "amd64"
purge: purge:
description: "Optional, deletes any previously installed go versions (yes|no)" description: "Optional, deletes any previously installed go versions (yes|no)"

View File

@ -37,6 +37,12 @@ if [[ "$GO_CHECK" ]]; then
sudo rm -r /usr/bin/gofmt sudo rm -r /usr/bin/gofmt
else else
#TODO1: if installed version matches requested version we can consider the job successful #TODO1: if installed version matches requested version we can consider the job successful
#go version go1.23.0 linux/amd64
GVC=$(go version)
if [[ "$GVC" == "go version go${DL_VERSION} linux/${DL_ARCH}" ]]; then
echo "Requested Go version already installed, skipping."
exit 0
fi
echo "FATAL: Go is already installed, set purge to 'yes' if you wish to update installed version" echo "FATAL: Go is already installed, set purge to 'yes' if you wish to update installed version"
exit 1 exit 1
fi fi