From 3d00aaf99727b0ac048096e05a539732c611cc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20Hurier=20=28Fmind=29?= Date: Sat, 24 Feb 2024 07:43:00 +0100 Subject: [PATCH] Test CI/CD --- .github/actions/commons/action.yml | 77 +++++++--------------- .github/workflows/on-release-published.yml | 43 +++++++----- pyproject.toml | 10 +-- 3 files changed, 52 insertions(+), 78 deletions(-) diff --git a/.github/actions/commons/action.yml b/.github/actions/commons/action.yml index b92df7b..eb7f432 100644 --- a/.github/actions/commons/action.yml +++ b/.github/actions/commons/action.yml @@ -1,55 +1,22 @@ -name: Commons -description: Perform common actions before all workflows. -inputs: - aws-region: - default: "eu-west-1" - description: "AWS Region" - aws-role: - default: "arn:aws:iam::585305677161:role/BIGDATA-GITHUBACTIONS-DATA-PROCESSING" - description: "AWS Role" - ca-domain: - default: "dataplatform" - description: "CodeArtifact Domain" - ca-domain-owner: - default: "585305677161" - description: "CodeArtifact Domain Owner" - ca-source: - default: "dktunited" - description: "CodeArtifact Source" - ca-user: - default: "aws" - description: "CodeArtifact User" - poetry-version: - default: "1.6.1" - description: "Poetry Version" - python-version: - default: "3.10" - description: "Python Version" -permissions: - id-token: write -runs: - using: composite - steps: - - name: Python - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python-version }} - - name: Poetry - uses: snok/install-poetry@v1 - with: - version: ${{ inputs.poetry-version }} - - name: Nexus - shell: bash - run: poetry source add --priority=default nexus http://nexus.nexus.svc.cluster.local:8081/repository/pypi/simple/ - - name: Cleaners - uses: dktunited/.github/actions/cleaner@main - - name: Credentials - uses: aws-actions/configure-aws-credentials@master - with: - aws-region: ${{ inputs.aws-region }} - role-to-assume: ${{ inputs.aws-role }} - - name: Docker Builders - uses: docker/setup-buildx-action@v3 - - name: Code Artifact - shell: bash - run: poetry config http-basic.${{ inputs.ca-source}} ${{ inputs.ca-user }} "$(aws codeartifact get-authorization-token --domain=${{ inputs.ca-domain }} --domain-owner=${{ inputs.ca-domain-owner }} --output text --duration=900 --query=authorizationToken)" +# name: Commons +# description: Perform common actions before all workflows. +# inputs: +# poetry-version: +# default: "1.6.1" +# description: "Poetry Version" +# python-version: +# default: "3.10" +# description: "Python Version" +# permissions: +# id-token: write +# runs: +# using: composite +# steps: +# - name: Python +# uses: actions/setup-python@v4 +# with: +# python-version: ${{ inputs.python-version }} +# - name: Poetry +# uses: snok/install-poetry@v1 +# with: +# version: ${{ inputs.poetry-version }} diff --git a/.github/workflows/on-release-published.yml b/.github/workflows/on-release-published.yml index 613f6e5..8e1594b 100644 --- a/.github/workflows/on-release-published.yml +++ b/.github/workflows/on-release-published.yml @@ -12,7 +12,22 @@ concurrency: cancel-in-progress: true group: on-release-published jobs: - docs: + # pages: + # runs-on: ubuntu-latest + # steps: + # - run: pipx install poetry + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.12 + # cache: 'poetry' + # - run: poetry install --only docs + # - run: poetry run inv docs + # - uses: JamesIves/github-pages-deploy-action@v4 + # with: + # folder: docs/ + # branch: gh-pages + packages: runs-on: ubuntu-latest steps: - run: pipx install poetry @@ -21,21 +36,13 @@ jobs: with: python-version: 3.12 cache: 'poetry' - - run: poetry install --only documenters - - run: poetry run inv docs - - uses: JamesIves/github-pages-deploy-action@v4 + - run: poetry run inv packages + - uses: docker/login-action@v3 with: - folder: docs/ - branch: gh-pages - # - run: poetry run inv checks - # - run: poetry run inv packages - # - uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - uses: docker/build-push-action@v5 - # with: - # context: . - # push: true - # tags: ghcr.io/fmind/mlops-python-package:latest + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/fmind/mlops-python-package:latest diff --git a/pyproject.toml b/pyproject.toml index eba773b..ac5e82e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,10 @@ invoke = "^2.2.0" ipykernel = "^6.29.0" pre-commit = "^3.6.0" -[tool.poetry.group.checkers.dependencies] +[tool.poetry.group.docs.dependencies] +pdoc = "^13.1.1" + +[tool.poetry.group.checks.dependencies] coverage = "^7.4.1" mypy = "^1.8.0" pylint = "^3.0.3" @@ -48,10 +51,7 @@ pytest-cov = "^4.1.0" pytest-xdist = "^3.5.0" pandera = { extras = ["mypy"], version = "^0.18.0" } -[tool.poetry.group.documenters.dependencies] -pdoc = "^13.1.1" - -[tool.poetry.group.formatters.dependencies] +[tool.poetry.group.formats.dependencies] black = "^24.1.1" isort = "^5.13.2"