-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c767a2
commit 7241307
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Scheduled Tests | ||
|
||
on: | ||
workflow_dispatch: # Manual trigger | ||
schedule: # Scheduled trigger | ||
- cron: "15,45 14-23,0-1 * * 1-5" # At minutes 15 and 45 past every hour from 14:00 through 01:00 on every day-of-week from Monday through Friday. | ||
- cron: "15 7,13 * * 1-5" # At minute 15 past hour 7 and 13 on every day-of-week from Monday through Friday. | ||
- cron: "0 14 * * 1" # At 14:00 on Monday (once a week). Any changes made here should also be reflected in the step titled "Force weekly run to bypass the version check". | ||
|
||
jobs: | ||
run_app_tests: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS Access Key ID. | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key. | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} # AWS Default Region. | ||
AWS_S3_BUCKET: "biothings-codebuild" # The S3 bucket name for storing application metadata. | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # The Slack webhook URL for sending notifications. | ||
SLACK_CHANNEL: "#observability-test" # The Slack channel where notifications will be posted. | ||
APPLICATION_NAME: "myvariant.info" # The name of the application being tested. It will be displayed in the Slack message. | ||
APPLICATION_METADATA_URL: "https://myvariant.info/metadata" # Path to the application metadata, typically a URL. | ||
APPLICATION_METADATA_FIELD: "build_date" # Notation to the build version field. Ex.: "metadata.build_version" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.11" ] | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Prepare virtual environment and dependences | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r requirements_web.txt | ||
git clone https://github.com/biothings/biothings_client.py.git | ||
cd biothings_client.py | ||
pip install . | ||
cd .. | ||
pip install .venv/lib/python${{ matrix.python-version }}/site-packages/biothings/tests/slack_test_notification | ||
- name: Force weekly run to bypass the version check | ||
if: github.event.schedule == '0 14 * * 1' | ||
run: echo "BYPASS_VERSION_CHECK=True" >> $GITHUB_ENV | ||
|
||
- name: Run pytest | ||
run: | | ||
source .venv/bin/activate | ||
python -m pytest src/tests/data biothings_client.py/tests/variant.py -s -vv | ||
# ### For debugging purposes in case of github action failure | ||
# ### Reference:https://github.com/mxschmitt/action-tmate | ||
# - name: Setup tmate debug session on failure | ||
# if: ${{ failure() }} | ||
# uses: mxschmitt/action-tmate@v3 |