Files
NLnetLabs-krill/.github/workflows/main.yml
T
ximon18andGitHub 5cd315b8bb GitHub Actions: debug tweaks
Temporarily disable undeploy while investigating failure to connect to remote Docker daemon.
Also attempt to print the output docker-compose ps and docker-compose logs if the build fails.
2019-11-11 12:16:21 +01:00

87 lines
3.2 KiB
YAML

name: E2E Test
on: [push, pull_request, issue_comment]
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 ${GITHUB_WORKSPACE}/../rpki-deploy/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 ${GITHUB_WORKSPACE}/../rpki-deploy/terraform/plugins/terraform-provider-dockermachine $HOME/.terraform.d/plugins/
- name: Decrypt SSH key
working-directory: ../rpki-deploy/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: ../rpki-deploy/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: ../rpki-deploy/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: Dump logs on failure
if: failure()
working-directory: ../rpki-deploy/terraform/krill-e2e-test/run_on_do
run: |
eval $(terraform output docker_env_vars)
pushd ../lib/docker
docker-compose ps
docker-compose logs
# - name: Undeploy
# if: always()
# working-directory: ../rpki-deploy/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 }}