Venice 0.4.169 #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Snouty is a github action build pipeline that attempts to build | |
# docker images and call an Antithesis webhook at the end of the process | |
# It is intended to work with a Pull Request (PR) request comment | |
# | |
# It requires the following: | |
# 1. /.antithesis/env file with REGISTRY, REPOSITORY, WEBHOOK_USER, WEBHOOK_URL environment variables defined | |
# 2. configure github secrets for a REST_API, ANTITHESIS_GAR_JSON_KEY and WEBHOOK_PASSWORD | |
# 3. Place this workflow yml in your ./github/workflows directory | |
# For more information, see antithesis.com | |
# | |
# To use snouty, simply type "snouty test [service]" | |
# [service] should be a directory in the repo that contains a Dockerfile that can be used | |
# to run docker build command | |
# | |
name: PR Snouty | |
on: | |
issue_comment: | |
types: [created] | |
env: | |
API_TOKEN: ${{ secrets.CHANG_PS_REST_TOKEN }} | |
WEBHOOK_PASSWORD: ${{ secrets.ANT_VENICE_WEBHOOK_PASS }} | |
COMMENT: ${{ github.event.comment.body }} | |
PR_URL: ${{ github.event.issue.pull_request.url }} | |
jobs: | |
pr_commented: | |
# This job only runs for pull request comments | |
name: PR comment | |
if: ${{ github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
echo This is the $COMMENT | |
- name: Download Snouty | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget unzip python3 | |
- run: | | |
wget -O $HOME/snouty.zip "https://www.dropbox.com/scl/fi/62em1ngxrge9aqjrw1wcx/snouty.zip?rlkey=b18byncprxiwmist0coifz193&dl=0" | |
- run: | | |
unzip $HOME/snouty.zip -d $HOME | |
- name: Install Snouty requirements | |
run: $HOME/install.sh | |
- name: Check out the repo first # Check out the main branch look for .antithesis/env | |
uses: actions/checkout@v4 | |
# Running this will populate additional environment variables | |
# from /.antithesis/env as well as the pull request | |
# that github actions can access include: | |
# REGISTRY, REPOSITORY, WEBHOOK_USER, WEBHOOK_URL, ANT_PR_BRANCH | |
- name: 1. Merge ENVARs | |
run: python3 $HOME/snouty.py populate_envars | |
- name: Check out the PR branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ANT_PR_BRANCH }} | |
- name: Login to GAR | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: _json_key | |
password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }} | |
- name: 2. Finding buildables | |
run: python3 $HOME/snouty.py find_buildable_path | |
- name: 3. Building + Pushing images | |
run: $HOME/build.sh | |
- name: 4. Verify build + reply on Github | |
run: python3 $HOME/snouty.py post_build_reply | |
- name: 5. Run webhook | |
run: python3 $HOME/snouty.py webhook |