Actions vagrant fix testing (#10) #30
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: Test playbook | |
on: | |
push: | |
branches: | |
- main | |
- actions-vagrant-change | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
workflow_dispatch: | |
jobs: | |
vagrant_test: | |
name: Test playbook on Vagrant box | |
runs-on: ubuntu-latest # macos-11 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Vagrant | |
run: | | |
wget https://releases.hashicorp.com/vagrant/2.3.7/vagrant_2.3.7-1_amd64.deb | |
sudo dpkg -i vagrant_2.3.7-1_amd64.deb | |
- name: Cache Vagrant deb | |
uses: actions/cache@v3 | |
with: | |
path: ./vagrant_2.3.7-1_amd64.deb | |
key: ${{ runner.os }}-vagrant-deb | |
restore-keys: | | |
${{ runner.os }}-vagrant-deb | |
- name: Set up VirtualBox | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y virtualbox | |
# - name: Cache ansible | |
# uses: actions/cache@v3 | |
# with: | |
# path: /usr/local/bin/ansible | |
# key: ${{ runner.os }}-ansible | |
# restore-keys: | | |
# ${{ runner.os }}-ansible | |
# | |
# - name: Setup Ansible via brew | |
# uses: lyricwulf/abc@v1 | |
# with: | |
# macos: ansible | |
- name: Setup ansible vault password | |
run: printf ${{ secrets.VAULT_PASS }} > .vault_pass | |
- name: Create SSH directory | |
run: mkdir -p ~/.ssh | |
- name: Setup pub key for keyless role | |
run: printf ${{ secrets.PUB_KEY }} > ~/.ssh/id_rsa.pub | |
- name: Cache Vagrant boxes | |
uses: actions/cache@v3 | |
with: | |
path: ~/.vagrant.d/boxes | |
key: ${{ runner.os }}-vagrant | |
restore-keys: | | |
${{ runner.os }}-vagrant | |
- name: Run vagrant up | |
run: vagrant up --provision | |
working-directory: ./tests |