Skip to content

Commit

Permalink
try installing in venv
Browse files Browse the repository at this point in the history
  • Loading branch information
tkw1536 committed Aug 2, 2023
1 parent 0a43dc2 commit 18c18fd
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 13 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish 'latest' Docker Image

on:
push:
branches: [main]

env:
REGISTRY: ghcr.io
IMAGE_NAME: jacobsalumni/membermanagement:latest
PLATFORMS: linux/amd64

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
- uses: docker/build-push-action@v2
with:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
platforms: ${{ env.PLATFORMS }}
context: .
pull: true
push: true
30 changes: 30 additions & 0 deletions .github/workflows/docker-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish 'prod' Docker Image

on:
push:
branches: [prod]

env:
REGISTRY: ghcr.io
IMAGE_NAME: jacobsalumni/membermanagement:prod
PLATFORMS: linux/amd64

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
- uses: docker/build-push-action@v2
with:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
platforms: ${{ env.PLATFORMS }}
context: .
pull: true
push: true
58 changes: 45 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,67 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Run 'poetry install'
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Install Chrome Webdriver
if: ${{ matrix.browser == 'chrome' }}
run: |
poetry add seleniumbase
python3 -m venv venv
source venv/bin/activate
pip install seleniumbase
sudo apt-get install -y google-chrome-stable
seleniumbase install chromedriver
poetry remove seleniumbase
deactivate
rm -rf venv
- name: Install Firefox Webdriver
if: ${{ matrix.browser == 'firefox' }}
run: |
poetry add seleniumbase
python3 -m venv venv
source venv/bin/activate
pip install seleniumbase
sudo apt-get install -y firefox
seleniumbase install geckodriver
poetry remove seleniumbase
- name: Fix broken pytest versions
seleniumbase install chromedriver
deactivate
rm -rf venv
- name: Run 'poetry install'
run: |
pip freeze
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Install Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Run 'yarn install'
run: yarn install

- name: Run 'yarn build'
run: yarn build
- name: Run 'pytest'
env:
SELENIUM_WEBDRIVER: ${{ matrix.browser }}
ENABLE_GEOCACHE_TEST: '1'
run: pytest

smoke:
name: Docker Smoke Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 'Build Docker Container'
run: docker build -t jacobsalumni/membermanagement .

- name: 'Run Docker Container'
run: |
docker run --rm -d --name=smoke -e DJANGO_SECRET_KEY=smoke -p 8080:80 jacobsalumni/membermanagement
sleep 10
- name: 'Check that the healthcheck API responds'
run: |
pytest --version
curl http://localhost:8080/healthcheck/
curl -L http://localhost:8080/healthcheck/static
docker stop smoke

0 comments on commit 18c18fd

Please sign in to comment.