Staging assets new #221
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: PR checks | |
on: pull_request | |
jobs: | |
run-image: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: assets | |
POSTGRES_USER: assets | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
swift: | |
image: bouncestorage/swift-aio | |
ports: | |
- 8080:8080 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
run: DOCKER_BUILDKIT=1 docker build --tag assets-ubuntu-com . | |
- name: Run image | |
run: | | |
docker run --detach --env-file .env --network host assets-ubuntu-com | |
sleep 1 | |
curl --head --fail --retry-delay 1 --retry 30 --retry-connrefused http://localhost | |
run-tests: | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: assets | |
POSTGRES_USER: assets | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
swift: | |
image: bouncestorage/swift-aio | |
ports: | |
- 8080:8080 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dotrun | |
run: | | |
sudo pip3 install dotrun requests==2.31.0 # requests version is pinned to avoid breaking changes, can be removed once issue is resolved: https://github.com/docker/docker-py/issues/3256 | |
chmod -R 777 . | |
- name: Install dependencies | |
run: dotrun install | |
- name: Build project | |
run: dotrun build | |
- name: Test site | |
run: dotrun & curl --head --fail --retry-delay 1 --retry 30 --retry-connrefused http://localhost:8017 | |
- name: Install additional dependencies | |
run: dotrun exec pip3 install coverage | |
- name: Run unit tests with coverage | |
run: dotrun exec coverage run --source=. --module unittest discover tests && bash <(curl -s https://codecov.io/bash) -cF python | |
lint-scss: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Lint scss | |
run: yarn lint-scss | |
lint-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install node dependencies | |
run: yarn install --immutable | |
- name: Install python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
sudo pip3 install flake8 black | |
- name: Lint python | |
run: yarn lint-python | |
check-inclusive-naming: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check inclusive naming | |
uses: canonical-web-and-design/inclusive-naming@main | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
reporter: github-pr-review | |
fail-on-error: true |