made resource group display optional #854
Workflow file for this run
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
# This is a basic workflow to help you get started with Actions | |
name: push_commits_no_tag | |
# Push to docker hub if tag has been created. | |
on: | |
push: | |
branches: | |
- '*' | |
env: | |
TEST_IMAGE: aquaveollc/tethysext-atcore:dev_${GITHUB_SHA} | |
IMAGE_TAG: dev_${GITHUB_SHA} | |
DOCKER_HUB_ORG: aquaveollc | |
DOCKER_REPO: tethysext-atcore | |
MAX_NUMBER_IMAGE: 5 | |
POSTGRES_DB: tethys_postgis | |
POSTGRES_PASSWORD: please_dont_use_default_passwords | |
POSTGRES_PORT: 5432 | |
TETHYS_PUBLIC_HOST: postgis | |
TETHYS_DB_HOST: postgis | |
TETHYS_DB_PORT: 5432 | |
TETHYS_DB_USERNAME: tethys_super | |
TETHYS_DB_PASSWORD: please_dont_use_default_passwords | |
TETHYS_DB_SUPERUSER: tethys_super | |
TETHYS_DB_SUPERUSER_PASS: please_dont_use_default_passwords | |
APP_DB_HOST: postgis | |
APP_DB_PORT: 5432 | |
APP_DB_USERNAME: tethys_super | |
APP_DB_PASSWORD: please_dont_use_default_passwords | |
ATCORE_TEST_DATABASE: postgresql://postgres:please_dont_use_default_passwords@postgis:5432/tethys_postgis | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Set Env | |
run: | | |
echo "KANIKO_CACHE_REGISTRY=aquaveollc/tethysext-atcore-cache" >> $GITHUB_ENV | |
echo "KANIKO_IMAGE=aquaveollc/tethysext-atcore" >> $GITHUB_ENV | |
- name: Set Tag | |
run: | | |
echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV | |
# If the branch is stable, we'll overwrite the TAG to include stable. | |
- name: Set Stable Tag | |
if: endsWith(github.ref, '/stable') | |
run: | | |
echo "TAG=stable" >> $GITHUB_ENV | |
- name: Test Tag | |
run: | | |
echo $TAG | |
- name: build and push tag | |
uses: aevea/action-kaniko@v0.10.0 | |
with: | |
# Docker registry where the image will be pushed | |
registry: docker.io | |
# Username used for authentication to the Docker registry | |
username: ${{ secrets.DOCKER_BUILDER_USERNAME }} | |
# Password used for authentication to the Docker registry | |
password: ${{ secrets.DOCKER_BUILDER_TOKEN }} | |
# Image name | |
image: ${{ env.KANIKO_IMAGE }} | |
# Image tag | |
tag: ${{ env.TAG }} | |
# Enables build cache | |
cache: true | |
# Docker registry meant to be used as cache | |
cache_registry: ${{ env.KANIKO_CACHE_REGISTRY }} | |
# Dockerfile filename | |
build_file: Dockerfile | |
startup_test: | |
needs: [build] | |
runs-on: ubuntu-latest | |
services: | |
postgis: | |
image: postgis/postgis:12-2.5 | |
env: | |
POSTGRES_HOST: postgis | |
POSTGRES_PASSWORD: please_dont_use_default_passwords | |
POSTGRES_DB: tethys_postgis | |
POSTGRES_PORT: 5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Docker login | |
run: docker login -u ${{ secrets.DOCKER_BUILDER_USERNAME }} -p ${{ secrets.DOCKER_BUILDER_TOKEN }} | |
- name: Pull Docker Image | |
run: | | |
docker pull ${{ env.TEST_IMAGE }} | |
- name: Run Salt Test | |
run: | | |
docker run --rm --name tethys_atcore --network ${{ job.services.postgis.network }} -e POSTGRES_DB=${{ env.POSTGRES_DB }} -e POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }} -e POSTGRES_PORT=${{ env.POSTGRES_PORT }} -e TETHYS_PUBLIC_HOST='${{ env.TETHYS_PUBLIC_HOST }}' -e TETHYS_DB_HOST='${{ env.TETHYS_DB_HOST }}' -e TETHYS_DB_PORT=${{ env.TETHYS_DB_PORT }} -e TETHYS_DB_USERNAME=${{ env.TETHYS_DB_USERNAME }} -e TETHYS_DB_PASSWORD=${{ env.TETHYS_DB_PASSWORD }} -e TETHYS_DB_SUPERUSER=${{ env.TETHYS_DB_SUPERUSER }} -e TETHYS_DB_SUPERUSER_PASS=${{ env.TETHYS_DB_SUPERUSER_PASS }} -e APP_DB_HOST=${{ env.APP_DB_HOST }} -e APP_DB_USERNAME=${{ env.APP_DB_USERNAME }} -e APP_DB_PASSWORD=${{ env.APP_DB_PASSWORD }} ${{ env.TEST_IMAGE }} /bin/bash -c "cd /usr/lib/tethys && source ./run.sh --test" | |
unit_tests: | |
needs: [build] | |
runs-on: ubuntu-latest | |
services: | |
postgis: | |
image: postgis/postgis:12-2.5 | |
env: | |
POSTGRES_HOST: postgis | |
POSTGRES_PASSWORD: please_dont_use_default_passwords | |
POSTGRES_DB: tethys_postgis | |
POSTGRES_PORT: 5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Docker login | |
run: docker login -u ${{ secrets.DOCKER_BUILDER_USERNAME }} -p ${{ secrets.DOCKER_BUILDER_TOKEN }} | |
- name: Pull Docker Image | |
run: | | |
docker pull ${{ env.TEST_IMAGE }} | |
- name: Run Docker Image | |
run: | | |
docker run -d --name tethys_atcore --network ${{ job.services.postgis.network }} -e ATCORE_TEST_DATABASE=${{ env.ATCORE_TEST_DATABASE }} -e POSTGRES_DB=${{ env.POSTGRES_DB }} -e POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }} -e POSTGRES_PORT=${{ env.POSTGRES_PORT }} -e TETHYS_PUBLIC_HOST='${{ env.TETHYS_PUBLIC_HOST }}' -e TETHYS_DB_HOST='${{ env.TETHYS_DB_HOST }}' -e TETHYS_DB_PORT=${{ env.TETHYS_DB_PORT }} -e TETHYS_DB_USERNAME=${{ env.TETHYS_DB_USERNAME }} -e TETHYS_DB_PASSWORD=${{ env.TETHYS_DB_PASSWORD }} -e TETHYS_DB_SUPERUSER=${{ env.TETHYS_DB_SUPERUSER }} -e TETHYS_DB_SUPERUSER_PASS=${{ env.TETHYS_DB_SUPERUSER_PASS }} -e APP_DB_HOST=${{ env.APP_DB_HOST }} -e APP_DB_USERNAME=${{ env.APP_DB_USERNAME }} -e APP_DB_PASSWORD=${{ env.APP_DB_PASSWORD }} ${{ env.TEST_IMAGE }} | |
sleep 120s | |
docker logs tethys_atcore | |
- name: Tweak Install for Testing | |
run: | | |
docker exec tethys_atcore bash -c 'micromamba run -n tethys pip list' | |
docker exec tethys_atcore bash -c 'cd /var/www/tethys/exts/tethysext-atcore && micromamba run -n tethys tethys install -d -q -w' | |
docker exec tethys_atcore bash -c 'touch /var/www/tethys/exts/tethysext-atcore/tethysext/atcore/tests/files/arc_grid/precip30min.*' | |
- name: Inspect Docker Network | |
run: | | |
docker network ls | |
docker network inspect ${{ job.services.postgis.network }} | |
- name: Run Tests | |
run: | | |
docker exec tethys_atcore bash -c 'cd /var/www/tethys/exts/tethysext-atcore && source ci-test.sh ${TETHYS_MANAGE}' | |
cleanup: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: only keeps the first 5 image | |
run: | | |
echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV | |
echo $TAG | |
. .github/scripts/clean_up_docker_hub.sh '${{ secrets.DOCKER_BUILDER_USERNAME }}' '${{ secrets.DOCKER_BUILDER_PASSWORD }}' '${{ env.DOCKER_HUB_ORG }}' '${{ env.DOCKER_REPO }}' '${{ env.MAX_NUMBER_IMAGE }}' | |