Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Change postgres hostname to something unique for github runner support"" #48

Draft
wants to merge 1 commit into
base: new_deployment
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/actions/build-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ inputs:
run_webpack:
default: false
required: false
disable_cache:
description: "Set to true to disable caching"
default: false
required: false

runs:
using: "composite"
Expand Down Expand Up @@ -59,6 +63,7 @@ runs:
name: node-yarn-lock
# Enable yarn download cache, @see https://github.com/actions/cache/tree/main/save#always-save-cache and https://github.com/actions/setup-node/issues/325
- name: Restore yarn cache
if: inputs.disable_cache == 'false'
uses: actions/cache/restore@v3
with:
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
Expand All @@ -71,8 +76,8 @@ runs:
run: yarn install --no-immutable --inline-builds
shell: bash
- name: Save yarn cache
if: inputs.disable_cache == 'false' && steps.install.outcome == 'success'
uses: actions/cache/save@v3
if: steps.install.outcome == 'success'
with:
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
path: ~/.yarn/berry/cache/
Expand Down
12 changes: 11 additions & 1 deletion .github/actions/build-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,26 @@ inputs:
run_build:
default: true
required: false
disable_cache:
description: "Set to true to disable caching"
default: false
required: false

runs:
using: "composite"
steps:
- name: Set up python
- name: Set up python (with cache)
if: inputs.disable_cache == 'false'
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python_version }}
cache: 'pip'
# needs wheel for make
- name: Set up python (without cache)
if: inputs.disable_cache == 'true'
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python_version }}
- name: install additional requirements
run: |
pip install setuptools wheel
Expand Down
49 changes: 35 additions & 14 deletions .github/workflows/build-node-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ on:
type: string
required: false
default: "ubuntu-22.04-large"
#disable_cache:
# description: "Set to true to disable caching"
# required: false
# type: boolean
# default: false
secrets:
DATAVISYN_BOT_REPO_TOKEN:
required: false
Expand All @@ -75,7 +80,8 @@ env:
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
PYPI_USERNAME: "datavisyn"
PYTHON_VERSION: "3.10"
WORKFLOW_BRANCH: "new_deployment"
WORKFLOW_BRANCH: "new_deployment_no_ports"
POSTGRES_HOSTNAME: postgres_${{ inputs.branch }}_${{ github.run_id }}

permissions:
contents: read
Expand All @@ -94,12 +100,12 @@ jobs:
runs-on: ${{ inputs.runs_on }}
steps:
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- name: Checkout github-workflows
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand All @@ -111,6 +117,7 @@ jobs:
npm_registry: ${{ env.NPM_REGISTRY }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: ${{ inputs.node_run_webpack }}
#disable_cache: ${{ inputs.disable_cache }}

build-python:
name: Python
Expand All @@ -121,12 +128,12 @@ jobs:
runs-on: ${{ inputs.runs_on }}
steps:
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- name: Checkout github-workflows
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand All @@ -136,7 +143,7 @@ jobs:
with:
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}

#disable_cache: ${{ inputs.disable_cache }}
# If cypress is used, build node and python sequentially as it is avoiding the duplicate install overhead
build-node-python-cypress:
name: Node, Python, Cypress
Expand All @@ -161,17 +168,21 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
--name postgres_${{ inputs.branch }}_${{ github.run_id }}

steps:
- name: Set system env variable to github env
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
- name: Connect service to default network
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- name: Checkout github-workflows
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand All @@ -183,11 +194,13 @@ jobs:
npm_registry: ${{ env.NPM_REGISTRY }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
#disable_cache: ${{ inputs.disable_cache }}
- name: Build python
uses: ./tmp/github-workflows/.github/actions/build-python
with:
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
#disable_cache: ${{ inputs.disable_cache }}
- name: Decrypt .env.enc and <app>/.env.enc
run: |
yarn run env:decrypt -pass env:ENV_PASSWORD || true
Expand All @@ -210,6 +223,8 @@ jobs:
make start
wait-on: "http://localhost:8080, http://localhost:9000/health"
env: ${{ secrets.CYPRESS_ENV }}
env:
POSTGRES_HOSTNAME: ${{ env.POSTGRES_HOSTNAME }}
- name: Run cypress component tests
uses: cypress-io/github-action@v6
with:
Expand Down Expand Up @@ -257,17 +272,21 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
--name postgres_${{ inputs.branch }}_${{ github.run_id }}

steps:
- name: Set system env variable to github env
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
- name: Connect service to default network
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- name: Checkout github-workflows
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand All @@ -279,11 +298,13 @@ jobs:
npm_registry: ${{ env.NPM_REGISTRY }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
#disable_cache: ${{ inputs.disable_cache }}
- name: Build python
uses: ./tmp/github-workflows/.github/actions/build-python
with:
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
#disable_cache: ${{ inputs.disable_cache }}
- name: Decrypt .env.enc and <app>/.env.enc
run: |
yarn run env:decrypt -pass env:ENV_PASSWORD || true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
if: ${{ always() && (needs.build-single.result == 'success' || needs.build-single.result == 'skipped') && (needs.build-workspace.result == 'success' || needs.build-workspace.result == 'skipped') && !(needs.build-workspace.result == 'skipped' && needs.build-single.result == 'skipped')}}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-single-product-part.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-workspace-product-part.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-helm-chart-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
revision_label: ${{ steps.get-revision-label.outputs.revision_label }}
steps:
# checkout repo to get package.json
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Full git history needed to get a proper
# list of changed files within `super-linter`
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-node-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:
echo "only the main branch can be published."
exit 1
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down Expand Up @@ -76,9 +76,9 @@ jobs:
echo "only the main branch can be published."
exit 1
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
echo "only the main branch can be published."
exit 1
# checkout specific source repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
Expand Down
Loading