* Without being a separate task, log pull won't happen on failure * Add a job at the end for notifying on success - since these only run nightly and on manual trigger, seems like it'd be nice to get notified of something happy!
109 lines
3.7 KiB
YAML
109 lines
3.7 KiB
YAML
on:
|
|
# Allows manual trigger on arbitrary branches via GitHub UI/API
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types: [prerelease]
|
|
schedule:
|
|
# Run nightly on weekdays at 05:00 UTC or midnight-ish in US time zones
|
|
- cron: '0 5 * * 1-5'
|
|
|
|
jobs:
|
|
setup-packet:
|
|
runs-on: self-hosted
|
|
name: Build Packet Instance
|
|
steps:
|
|
- name: Code Checkout
|
|
uses: actions/checkout@v1
|
|
- name: Create packet instance
|
|
run: ./.ci/spec/create-packet.sh
|
|
working-directory: ${{github.workspace}}
|
|
env:
|
|
VAGRANT_CI_LOADER_BUCKET: ${{ secrets.VAGRANT_CI_LOADER_BUCKET }}
|
|
|
|
setup-hosts:
|
|
runs-on: self-hosted
|
|
name: Vagrant-Spec Start Hosts
|
|
needs: setup-packet
|
|
strategy:
|
|
matrix:
|
|
host_os: ['hashicorp/bionic64']
|
|
guest_os: ['hashicorp-vagrant/ubuntu-16.04']
|
|
providers: ['virtualbox', 'docker']
|
|
steps:
|
|
- name: Code Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Create packet host for tests (provider ${{ matrix.providers }})
|
|
run: ./.ci/spec/create-hosts.sh
|
|
working-directory: ${{github.workspace}}
|
|
env:
|
|
VAGRANT_HOST_BOXES: ${{matrix.host_os}}
|
|
VAGRANT_GUEST_BOXES: ${{matrix.guest_os}}
|
|
VAGRANT_PRERELEASE_VERSION: ${{ github.event.client_payload.prerelease_version }}
|
|
VAGRANT_SPEC_PROVIDERS: ${{matrix.providers}}
|
|
VAGRANT_CI_LOADER_BUCKET: ${{ secrets.VAGRANT_CI_LOADER_BUCKET }}
|
|
|
|
spec-tests:
|
|
runs-on: self-hosted
|
|
name: Vagrant-Spec Tests
|
|
needs: setup-hosts
|
|
strategy:
|
|
matrix:
|
|
host_os: ['hashicorp/bionic64']
|
|
guest_os: ['hashicorp-vagrant/ubuntu-16.04']
|
|
docker_images: ['nginx']
|
|
providers: ['virtualbox', 'docker']
|
|
steps:
|
|
- name: Run Tests with host ${{ matrix.host_os }} using provider ${{ matrix.providers }}
|
|
run: ./.ci/spec/run-test.sh
|
|
working-directory: ${{github.workspace}}
|
|
env:
|
|
VAGRANT_HOST_BOXES: ${{matrix.host_os}}
|
|
VAGRANT_GUEST_BOXES: ${{matrix.guest_os}}
|
|
VAGRANT_SPEC_PROVIDERS: ${{matrix.providers}}
|
|
VAGRANT_DOCKER_IMAGES: ${{matrix.docker_images}}
|
|
VAGRANT_CI_LOADER_BUCKET: ${{ secrets.VAGRANT_CI_LOADER_BUCKET }}
|
|
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
|
|
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
|
|
- name: Pull log from guest
|
|
if: always()
|
|
run: ./.ci/spec/pull-log.sh
|
|
env:
|
|
VAGRANT_HOST_BOXES: ${{matrix.host_os}}
|
|
VAGRANT_GUEST_BOXES: ${{matrix.guest_os}}
|
|
VAGRANT_SPEC_PROVIDERS: ${{matrix.providers}}
|
|
VAGRANT_DOCKER_IMAGES: ${{matrix.docker_images}}
|
|
VAGRANT_CI_LOADER_BUCKET: ${{ secrets.VAGRANT_CI_LOADER_BUCKET }}
|
|
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
|
|
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
|
|
- name: Upload log
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: vagrant-spec-${{matrix.providers}}.log
|
|
path: ${{ github.workspace }}/vagrant-spec.log
|
|
|
|
cleanup:
|
|
runs-on: self-hosted
|
|
name: Cleanup Post Vagrant-Spec Tests
|
|
needs: spec-tests
|
|
if: always()
|
|
steps:
|
|
- name: Clean Packet
|
|
run: ./.ci/spec/clean-packet.sh
|
|
- name: Clean Workspace
|
|
run: rm -rf ${{ github.workspace }}
|
|
|
|
notify-on-success:
|
|
runs-on: self-hosted
|
|
name: Notify on Success
|
|
needs: spec-tests
|
|
if: success()
|
|
steps:
|
|
- name: Notify on Success
|
|
run: ./.ci/spec/notify-success.sh
|
|
env:
|
|
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
|
|
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
|