Running unittest #594
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
--- | |
name: Running unittest | |
on: | |
# Trigger the workflow on push or pull request, but only for the master branch | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# Trigger the workflow on cron schedule | |
schedule: | |
- cron: '7 0 * * *' | |
jobs: | |
unittest: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup Minikube | |
uses: manusa/actions-setup-minikube@v2.7.1 | |
with: | |
minikube version: 'v1.26.1' | |
kubernetes version: 'v1.25.0' | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.6' | |
- name: Install python requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run unittest - runners | |
run: ./run_tests.sh | |
approve: | |
needs: unittest | |
runs-on: ubuntu-20.04 | |
steps: | |
- run: | # approve the pull request | |
curl --request POST \ | |
--url https://api.github.com/repos/${{github.repository}}/pulls/${{github.event.number}}/reviews \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
-d '{"event":"APPROVE"}' |