Skip to content

[NO-TICKET] 🐛 Fix docker-compose command in CI #29

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

Draft
wants to merge 2 commits into
base: opengb-develop
Choose a base branch
from
Draft
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
42 changes: 20 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
push:
branches:
- "develop"
- "main"
- 'develop'
- 'main'

jobs:
# Currently GH Actions provides no simple method for "sharing"
Expand All @@ -20,11 +20,11 @@ jobs:
matrix:
test_env: [django, functional, api]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
# using `-v3` in key to clear old cache due to errors
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
docker volume create --name=seed_pgdata
docker volume create --name=seed_media
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
- name: Migrate
env:
DJANGO_LOG_LEVEL: ERROR
Expand All @@ -52,16 +52,14 @@ jobs:
docker exec --env DJANGO_LOG_LEVEL seed_web ./manage.py migrate
docker exec --env DJANGO_LOG_LEVEL seed_web ./manage.py create_default_user [email protected] --password=demo123
docker exec --env DJANGO_LOG_LEVEL seed_web /bin/bash -c 'echo "y" | ./manage.py make_superuser --user [email protected]'
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
npm install
sudo apt update
sudo apt install -y xvfb
# use unstable now which is 116, 115 was marked as unstable recently and needs to be patched.
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
sudo apt install -y /tmp/chrome.deb
google-chrome --version
- name: Test Django
if: ${{ matrix.test_env == 'django' }}
env:
Expand All @@ -76,7 +74,7 @@ jobs:
DJANGO_LOG_LEVEL: ERROR
run: |
docker exec seed_web touch /seed/config/settings/local_untracked.py
docker exec --env SEED_PM_UN --env SEED_PM_PW --env DJANGO_LOG_LEVEL --env SF_INSTANCE --env SF_USERNAME --env SF_PASSWORD --env SF_SECURITY_TOKEN --env SF_DOMAIN seed_web coverage run manage.py test seed --settings=config.settings.docker_dev
docker exec --env SEED_PM_UN --env SEED_PM_PW --env DJANGO_LOG_LEVEL --env SF_INSTANCE --env SF_USERNAME --env SF_PASSWORD --env SF_SECURITY_TOKEN --env SF_DOMAIN seed_web coverage run manage.py test --settings=config.settings.docker_dev
if [[ ! -z "${COVERALLS_REPO_TOKEN}" ]]; then
docker exec --env COVERALLS_REPO_TOKEN seed_web coveralls
else
Expand All @@ -85,13 +83,10 @@ jobs:
- name: Test Frontend
if: ${{ matrix.test_env == 'functional' }}
env:
DISPLAY: ":99"
DISPLAY: ':99'
run: |
CHROME_VERSION=$(google-chrome --version | awk '{ print $NF }')
echo "Getting webdriver for chrome version ${CHROME_VERSION}"
./node_modules/protractor/bin/webdriver-manager update --versions.chrome=${CHROME_VERSION} --gecko=false
Xvfb :99 &
./node_modules/protractor/bin/protractor seed/static/seed/tests/protractor-tests/protractorConfig.js
npm test
- name: Test API
if: ${{ matrix.test_env == 'api' }}
run: |
Expand All @@ -104,16 +99,19 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
tox_env: [docs, precommit, mypy]
tox_env: [docs, precommit, mypy, lint]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/setup-node@v4
with:
python-version: "3.9"
node-version: 20
- name: Install deps
run: |
pip install --upgrade pip
pip install tox==2.7.0
pip install tox==4.20.0
sudo apt update
sudo apt install gdal-bin
- name: Setup config
Expand Down
Loading