Bump google-api-python-client in the dependencies group #688
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: Build and test Docker image | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-22.04 | |
env: | |
COMPOSE_FILE: ./test/docker-compose.yml | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks out repository under $GITHUB_WORKSPACE, so the job can access it | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Set up python 3.10 for linting and comics test script | |
- name: Set up python3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
# Install pyflakes linter, pillow dependency for comics test script, and build image for IRCd used in tests | |
- name: Install testing dependencies | |
run: | | |
pip install pyflakes | |
pip install pillow | |
docker compose build weercd | |
# Lint entire project | |
- name: Lint with pyflakes | |
run: pyflakes start.py desertbot/ | |
# Check correctness of comics data | |
- name: Comics test | |
run: python test/comics.py | |
# Build desertbot docker image | |
- name: Docker build | |
run: docker compose build | |
# Decrypt test API keys using gpg if secrets available | |
- name: Decrypt test API keys | |
env: | |
GPG_PASSPHRASE: ${{ secrets.API_KEY_GPG_PASSPHRASE }} | |
if: env.GPG_PASSPHRASE != null | |
run: gpg --batch --passphrase "$GPG_PASSPHRASE" --output test/APIKeys.json --decrypt test/api_keys.json.enc | |
# make a dummy file to make docker-compose play nice if secrets not available | |
- name: Work around lack of test API keys | |
env: | |
GPG_PASSPHRASE: ${{ secrets.API_KEY_GPG_PASSPHRASE }} | |
if: env.GPG_PASSPHRASE == null | |
run: echo "{}" > test/APIKeys.json | |
# Run tests | |
- name: Docker tests | |
run: | | |
docker compose run --rm desertbot | |
# Login to docker hub if this is a push to master | |
- name: Docker login | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
uses: docker/login-action@v2.1.0 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# Push image to docker hub if this is a push to master | |
- name: Docker push | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
run: docker compose push desertbot |