Files
NLnetLabs-krill/.github/workflows/main.yml
T

78 lines
2.7 KiB
YAML

name: E2E Test
on: [push, pull_request]
jobs:
krill_e2e_test:
name: deploy_and_test
runs-on: ubuntu-18.04
steps:
- name: checkout Krill
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: checkout the E2E test framework
uses: actions/checkout@v1
with:
repository: nlnetlabs/rpki-deploy
ref: master
fetch-depth: 1
# Use a modified Dockerfile which builds off a partially built base image
# to leverage an existing Cargo cache and thus speed up deployment.
- name: Install modified Dockerfile into Krill checkout
run: |
cp terraform/krill-e2e-test/lib/docker/krill/Dockerfile ${GITHUB_WORKSPACE}/../krill/Dockerfile
- name: Install Terraform
uses: marocchino/setup-terraform@v1
with:
version: "0.12.13"
- name: Install Terraform plugins
run: |
mkdir -p $HOME/.terraform.d/plugins/
cp terraform/plugins/terraform-provider-dockermachine $HOME/.terraform.d/plugins/
- name: Decrypt SSH key
working-directory: terraform/krill-e2e-test
run: |
./decrypt-ssh-key.sh
ls -la $HOME/secrets/
env:
DECRYPT_PW: ${{ secrets.DECRYPT_PW }}
# Don't lock the state file, otherwise if the user cancels the build via the
# GitHub Actions UI the terraform destroy cleanup step will fail.
- name: Deploy
working-directory: terraform/krill-e2e-test/run_on_do
timeout-minutes: 30
run: |
terraform init
terraform apply -lock=false -auto-approve -var "ssh_key_path=$HOME/secrets/ssh_key" -var "krill_build_path=${GITHUB_WORKSPACE}/../krill"
env:
# Don't embed env var references in env var definitions here, instead
# pass those using -var on the command line.
TF_VAR_do_token: ${{ secrets.DO_TOKEN }}
TF_VAR_run_tests: false
TF_VAR_size: s-8vcpu-32gb
- name: Run tests
working-directory: terraform/krill-e2e-test/run_on_do
run: terraform apply -auto-approve -var "ssh_key_path=$HOME/secrets/ssh_key" -var "krill_build_path=${GITHUB_WORKSPACE}/../krill"
env:
# Don't embed env var references in env var definitions here, instead
# pass those using -var on the command line.
TF_VAR_do_token: ${{ secrets.DO_TOKEN }}
TF_VAR_run_tests: true
- name: Undeploy
if: always()
working-directory: terraform/krill-e2e-test/run_on_do
run: terraform destroy -auto-approve -var "ssh_key_path=$HOME/secrets/ssh_key" -var "krill_build_path=${GITHUB_WORKSPACE}/../krill"
env:
# Don't embed env var references in env var definitions here, instead
# pass those using -var on the command line.
TF_VAR_do_token: ${{ secrets.DO_TOKEN }}