0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 19:41:46 +01:00
posthog/.github/workflows/ci-hobby.yml
James Greenhill ddc7d44a1e
feat: hobby ci script to e2e test hobby deploy on DO (#12153)
* feat: hobby ci script to e2e test hobby deploy on DO

* checkpoint

* script in a decent spot

* fixes

* more fixes for script

* github action to run python

* Update env var for DO token

* hobby test name

* run on pull requests

* action fixes

* actions fixes

* actions fixes

* actions fixes

* support release testing as well

* actions fixes

* retry tweaks. GHA are a pain

* exit 0 for success and 1 for failure

* handle signals better

* fixes

* retry deletion

* Don't import packages that don't exist

* kwargs the args

* break out of retries

* done

* don't run on master pushes

* Use staging for lets encrypt

* feedback

* feedback timeout context

* feedbacks

* fix issue where response could be referenced before initialization
2022-10-22 02:47:13 +00:00

40 lines
1.4 KiB
YAML

# This workflow runs e2e smoke test for hobby deployment
# To check on the status of the instance if this fails go to DO open the instance
# Instance name should look like `do-ci-hobby-deploy-xxxx`
# SSH onto the instance and `tail -f /var/log/cloud-init-output.log`
name: e2e - hobby smoke test
on:
push:
branches:
- 'release-*.*'
pull_request:
paths:
- docker-compose.hobby.yml
- bin/deploy-hobby
- .github/workflows/ci-hobby.yml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
# this is a slow one
timeout-minutes: 30
name: Setup DO Hobby Instance and test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies
- name: Get python deps
run: pip install python-digitalocean==1.17.0 requests==2.28.1
- name: Get branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Run smoke tests on DO
run: python3 bin/hobby-ci.py "${{ env.BRANCH_NAME }}"
env:
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}