This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
Update README.md #2676
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: Cook Scheduler, CLI, and JobClient unit tests | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
- 'build**' | |
- kubernetes_integration | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
env: | |
PYTEST_ADDOPTS: --color=yes | |
MESOS_NATIVE_JAVA_LIBRARY: /usr/lib/libmesos.so | |
CLJ_HTTP_ASYNC_POOL_TEST_DURATION_MULTIPLIER: 5 | |
GDRIVE_LOG_POST_URL: https://script.google.com/macros/s/AKfycbxOB55OzrQSbpZO_0gzsxZaJ8LaUWWo3PDLNc-gCiMN1iObxu7x/exec | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Showcase docker state. | |
run: docker ps | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/project.clj') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.6.x' | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Setup tests | |
run: | | |
./cli/travis/setup.sh | |
cd scheduler && ./travis/setup.sh | |
- name: JobClient Java unit tests | |
run: cd ./jobclient/java && mvn test -X | |
- name: JobClient Python unit tests | |
run: cd ./jobclient/python && python -m pytest | |
- name: CLI unit tests | |
run: cd ./cli && python -m pytest | |
- name: Setup the database | |
run: cd ./scheduler/postgresql && bin/setup-database.sh | |
env: | |
PGPASSWORD: postgres | |
COOK_SCHEMA: cook_local | |
- name: Scheduler Unit tests | |
run: cd ./scheduler && lein with-profile +test test :all-but-benchmark | |
env: | |
PGPASSWORD: postgres | |
COOK_DB_TEST_PG_USER: cook_scheduler | |
COOK_DB_TEST_PG_SERVER: 127.0.0.1 | |
COOK_DB_TEST_PG_SCHEMA: cook_local | |
services: | |
# Give it cook-postgres to match what our external build scripts use. | |
cook-postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 |