Skip to content

Commit

Permalink
Multiple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stv-io committed Nov 15, 2023
1 parent 0d8ede9 commit 9244010
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 32 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/tailscale.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: testing tfswitch action

on:
push:
branches:

jobs:
test-terraform-version-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch for .terraform-version file
run: |
echo "1.6.3" > .terraform-version
tfswitch
terraform --version
test-command-line-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch with the version on the command line
run: |
tfswitch 1.6.2
terraform --version
test-env-var-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch with the version in an env var
run: |
export TF_VERSION=1.6.1
tfswitch 1.6.2
terraform --version
test-install-latest-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch with the version in an env var
run: |
tfswitch -u
terraform --version
test-terraform-tf-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch with the version in an env var
run: |
cat << EOF > versions.tf
terraform {
required_version = ">= 0.12.9"
}
EOF
tfswitch
terraform --version
9 changes: 5 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ inputs:
version:
description: 'The tfswitch version'
required: false
default: "0.13.1308"

runs:
using: 'composite'
Expand All @@ -16,17 +17,17 @@ runs:
run: |
echo "::error title=⛔ error hint::This action is only supported on Linux Runners"
exit 1
- name: Download and install tfswitch
- name: Install tfswitch
shell: bash
id: download
id: install
# env:
# VERSION: ${{ inputs.version }}
# SHA256SUM: ${{ inputs.sha256sum }}
# SHA256SUM: ${{ inputs.sha256sum }}
run: |
curl -sLo install.sh https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
mkdir -p $HOME/.bin
./install.sh -b $HOME/.bin
./install.sh ${{ inputs.version }} -b $HOME/.bin
$HOME/.bin/tfswitch --version
export PATH=$PATH:$HOME/.bin
tfswitch --version
Expand Down

0 comments on commit 9244010

Please sign in to comment.