Bump pydantic from 1.8.2 to 1.10.13 #26
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: Project CI (Docker) | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
setup: | |
name: setup | |
runs-on: ubuntu-latest | |
outputs: | |
sha_short: ${{ steps.sha.outputs.sha_short }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: generate short commit hash | |
id: sha | |
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
python: | |
env: | |
ORG: "parsertongue" | |
IMAGE_NAME: "clu-phontools" | |
TAG: "latest" | |
DOCKERFILE: "Dockerfile" | |
name: "Python library" | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
# Checkout code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Setup docker | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Library (docker) | |
- name: "Build multiarch docker image (clu-phontools)" | |
#working-directory: ./ | |
run: | | |
docker build -f ${DOCKERFILE} -t "${ORG}/${IMAGE_NAME}:latest" . | |
# docker buildx build --load --platform linux/amd64 -f ${DOCKERFILE} -t "${ORG}/${IMAGE_NAME}:amd64" . | |
# docker buildx build --load --platform linux/arm64 -f ${DOCKERFILE} -t "${ORG}/${IMAGE_NAME}:arm64" . | |
# docker images | |
# Tests | |
- name: "Test multiarch build (clu-phontools)" | |
run: | | |
docker images | |
# docker run -i "${ORG}/${IMAGE_NAME}:amd64" python --version | |
# docker run -i "${ORG}/${IMAGE_NAME}:arm64" python --version | |
- name: "Tests and coverage (clu-phontools)" | |
run: | | |
docker run -i "${ORG}/${IMAGE_NAME}" green -vvv /app | |
# Type checks | |
- name: "Type checks (clu-phontools)" | |
continue-on-error: true | |
run : | | |
docker run -i "${ORG}/${IMAGE_NAME}" mypy --ignore-missing-imports --follow-imports=skip --strict-optional /app | |
# publish | |
- name: "Publish docker image (clu-phontools image)" | |
if: github.ref == 'refs/heads/main' | |
run: | | |
docker image push --all-tags ${ORG}/${IMAGE_NAME} | |
# docker buildx build --platform=linux/amd64,linux/arm64 -f ${DOCKERFILE} --push -t "${ORG}/${IMAGE_NAME}:${TAG}" -t "${ORG}/${IMAGE_NAME}:${{ needs.setup.outputs.sha_short }}" . | |
# code formatting and linting | |
- name: "Code formatting & linting" | |
continue-on-error: true | |
run: docker run -i "${ORG}/${IMAGE_NAME}" black --check /app | |
# docs | |
- name: "Create documentation (API docs)" | |
run: docker run -i -v "$GITHUB_WORKSPACE:/app" "${ORG}/${IMAGE_NAME}" pdoc --html -c latex_math=True --force --output-dir docs/api clu | |
# docs | |
- name: "Create documentation (other)" | |
run: docker run -i -v "$GITHUB_WORKSPACE:/app" "${ORG}/${IMAGE_NAME}" mkdocs build -c | |
#run: docker run -i -v "$GITHUB_WORKSPACE:/app" "${ORG}/${IMAGE_NAME}" portray as_html | |
# - name: Deploy docs | |
# if: github.ref == 'refs/heads/main' | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# # see https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#about-the-github_token-secret | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: ./site | |
# user_name: 'github-actions[bot]' | |
# user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} |