Skip to content

build(deps): bump setuptools from 68.2.2 to 70.0.0 (#95) #108

build(deps): bump setuptools from 68.2.2 to 70.0.0 (#95)

build(deps): bump setuptools from 68.2.2 to 70.0.0 (#95) #108

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and publish
on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
pull_request:
branches: [ main ]
env:
IMAGE_NAME: ghcr.io/ibm/apiconnect-trawler/trawler
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
SECRETS=test-assets coverage run --source . -m py.test -Werror -p no:unraisableexception
coverage report
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Clone the repository
uses: actions/checkout@v2
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.ref_name }}
containerfiles: |
./Containerfile
- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- name: Push to GitHub Container Repository
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: "ghcr.io"
image: ${{ steps.build-image.outputs.image }}
tags: latest ${{ github.ref_name }}