Skip to content

Commit

Permalink
Test CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
fmind committed Feb 24, 2024
1 parent 29f06ed commit 3d00aaf
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 78 deletions.
77 changes: 22 additions & 55 deletions .github/actions/commons/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
43 changes: 25 additions & 18 deletions .github/workflows/on-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down

0 comments on commit 3d00aaf

Please sign in to comment.