Skip to content

Debug ci

Debug ci #208

Workflow file for this run

name: CI
on:
workflow_call:
pull_request:
schedule:
# NOTE: We run this weekly at 1 am UTC on every Saturday
- cron: '0 1 * * 6'
jobs:
# This is based on this workflow, with an additional test env setup method
# StackStorm-Exchange/ci/.github/workflows/pack-build_and_test.yaml@master
build_and_test:
runs-on: ubuntu-22.04
name: 'Build and Test / Python ${{ matrix.python-version-short }}'
strategy:
matrix:
include:
- python-version-short: "3.9"
python-version: 3.9.21
consul-version: "1.22.7-1"
vault-version: "2.0.0-1"
hvac-gh-tag: "v2.4.0"
- python-version-short: "3.10"
python-version: 3.10.16
consul-version: "1.22.7-1"
vault-version: "2.0.0-1"
hvac-gh-tag: "v2.4.0"
- python-version-short: "3.11"
python-version: 3.11.11
consul-version: "1.22.7-1"
vault-version: "2.0.0-1"
hvac-gh-tag: "v2.4.0"
steps:
- name: Checkout Pack Repo and CI Repos
uses: StackStorm-Exchange/ci/.github/actions/checkout@master
- name: Checkout github.com/hvac/hvac
uses: actions/checkout@v2
with:
path: hvac
repository: hvac/hvac
# main = the release branch; devel = the active development branch
ref: ${{ matrix.hvac-gh-tag }}
fetch-depth: 0
- name: Install APT Dependencies
uses: StackStorm-Exchange/ci/.github/actions/apt-dependencies@master
with:
cache-version: v0
- name: Install Python Dependencies
uses: StackStorm-Exchange/ci/.github/actions/py-dependencies@master
with:
cache-version: v0
python-version: ${{ matrix.python-version }}
# task copied (Apache 2.0 License) from
# github.com/hvac/hvac .github/workflows/lint-and-test.yml
- name: Install Vault and Consul (for integration tests)
working-directory: pack
shell: bash
run: |
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/hashicorp.gpg
echo "deb [arch=amd64, signed-by=/etc/apt/trusted.gpg.d/hashicorp.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
| sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update \
-o Dir::Etc::sourceparts="-" \
-o APT::Get::List-Cleanup="0" \
-o Dir::Etc::sourcelist="sources.list.d/hashicorp.list"
sudo apt install consul=${{ matrix.consul-version }} vault=${{ matrix.vault-version }}
# We disble cap_ipc_lock here as its generally incompatabile with GitHub
# Actions' runtime environments.
sudo setcap cap_ipc_lock= /usr/bin/vault
sudo tee /etc/consul.d/bind_addr.conf <<<'bind_addr = "127.0.0.1"'
sudo systemctl cat consul.service
echo CONSUL CONF
sudo cat /etc/consul.conf || true
sudo cat /etc/consul.env || true
echo CONSUL CONF DIR
sudo cat /etc/consul.conf.d/*
sudo systemctl restart consul || true
sudo journalctl -eu consul
# force stop here for debug
exit 1
sudo systemctl restart vault
- name: Setup hvac symlinks
shell: bash
env:
HVAC_DIR: ${{ github.workspace }}/hvac
run: |
# using symlinks allows us to import tests.utils.* without adding
# the rest of the hvac tests. tests.utils also uses config_files,
# so make that available too.
set -eux
for x in utils config_files; do
rm -f ${ROOT_DIR}/tests/${x}
# relative (-r) allows the symlink to work in vagrant
ln -rs ${HVAC_DIR}/tests/${x} ${ROOT_DIR}/tests/${x}
ls -ld ${ROOT_DIR}/tests/${x}
done
- name: Run pack tests
uses: StackStorm-Exchange/ci/.github/actions/test@master
with:
enable-common-libs: false
services:
mongo:
image: mongo:7.0
ports:
- 27017:27017
rabbitmq:
image: rabbitmq:3
ports:
- 5672:5672
#redis:
# image: redis
# ports:
# - 6379:6379