Factor out setup

This commit is contained in:
Greg Hellings
2022-06-01 00:01:15 -05:00
parent 714fa99582
commit 2184b29795
4 changed files with 49 additions and 70 deletions
@@ -16,6 +16,4 @@ runs:
# Install packer.io
curl -O https://releases.hashicorp.com/packer/${{ inputs.version }}/packer_${{ inputs.version }}_linux_amd64.zip
unzip packer_${{ inputs.version }}_linux_amd64.zip
mkdir -p ~/bin/
chmod +x packer
mv packer ~/bin/packerio
+37
View File
@@ -0,0 +1,37 @@
name: Setup environment
description: Sets up some basic components of the environment
inputs:
ansible:
description: Install Ansible as well
required: false
default: false
runs:
using: composite
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Python 3
uses: actions/setup-python@v3
with:
python-version: "3"
- name: Setup pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: python-pip
- name: Install Pip and tox
shell: bash
run: |
set -exo pipefail
python3 -m pip install -U pip
pip install -U wheel
pip install -U tox
- name: Install Ansible
if: inputs.ansible
shell: bash
run: |
set -exo pipefail
pip install -U ansible
ansible-galaxy collection install -r ansible/requirements.yml