Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jan 5, 2025
1 parent efee1ee commit c9ee47e
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 445 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test

on: ["push"]
jobs:
lint:
runs-on: ubuntu-latest
name: Python Black Lint Check
steps:
- name: Check out repository
uses: actions/[email protected]

- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.8

- name: Install Python dependencies
run: pip install black nbqa

- name: Run Black on Python files
run: black --check $(find . -type f -name "*.py")
build:
uses: ./.github/workflows/docker.yml
with:
registry-dockerhub-enable: ${{ github.event_name != 'pull_request' }}
registry-repo-name: AGiXT
registry-readme: ./docs/README.md
secrets:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
test-agixt-postgres:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
with:
notebook: tests/endpoint-tests.ipynb
image: ${{ needs.build.outputs.primary-image }}
port: "7437"
database-type: "postgresql"
report-name: "agixt-postgres-tests"
needs: build
test-agixt-sqlite:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
with:
notebook: tests/endpoint-tests.ipynb
image: ${{ needs.build.outputs.primary-image }}
port: "7437"
database-type: "sqlite"
report-name: "agixt-sqlite-tests"
needs: build
24 changes: 0 additions & 24 deletions .github/workflows/code-style-check.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Build and publish docker containers
name: Docker Build and Publish

on:
workflow_call:
inputs:
tags:
type: string
default: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=raw,value={{branch}}
type=semver,pattern={{raw}},enable=${{ github.ref_type == 'tag' }}
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
type=sha
flavor:
type: string
Expand Down Expand Up @@ -42,7 +41,7 @@ on:
default: ${{ github.event.repository.name }}
registry-dockerhub-enable:
type: boolean
default: true
default: false
registry-github-enable:
type: boolean
default: true
Expand All @@ -54,29 +53,27 @@ on:
default: ubuntu-latest
platforms:
type: string
default: linux/amd64
default: linux/amd64,linux/arm64/v8
cache-from:
type: string
default: type=gha
cache-to:
type: string
default: type=gha,mode=max
pre-free-disk-space:
type: boolean
default: false
outputs:
digest:
description: "Digest of docker image"
value: ${{ jobs.build_publish_docker.outputs.digest }}
value: ${{ jobs.build.outputs.digest }}
primary-image:
description: "Primary full name of pushed docker image"
value: ${{ jobs.build_publish_docker.outputs.primary-image }}
value: ${{ jobs.build.outputs.primary-image }}
secrets:
DOCKERHUB_TOKEN:
required: false

jobs:
build_publish_docker:
build:
name: Docker (${{ inputs.registry-github-enable == true && inputs.registry-dockerhub-enable == true && 'GitHub, DockerHub' || inputs.registry-github-enable == true && 'GitHub' || 'DockerHub' }})
runs-on: ${{ inputs.runs-on }}

permissions:
Expand All @@ -88,31 +85,16 @@ jobs:
primary-image: ${{ steps.get-primary-image.outputs.primary-image }}

steps:
- name: Free Disk Space (Ubuntu)
if: inputs.pre-free-disk-space
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true

- name: Log in to Docker Hub
if: inputs.registry-dockerhub-enable
uses: docker/login-action@v3
uses: docker/login-action@v3.3.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Github registry
if: inputs.registry-github-enable
uses: docker/login-action@v3
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -125,16 +107,16 @@ jobs:
echo "dockerhub-repo=${{ vars.DOCKERHUB_USERNAME }}/${{ inputs.registry-repo-name }}" >> "$GITHUB_ENV"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v3.2.0

# Needed for cache layers on github registry
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.1.0
uses: docker/setup-buildx-action@v3.7.1

## Cache based contexts
- name: Restore cached context
if: inputs.context-cache
uses: actions/cache/restore@v4.0.1
uses: actions/cache/restore@v4.1.2
with:
path: cached-context
key: ${{ inputs.context-cache }}
Expand All @@ -147,13 +129,13 @@ jobs:

## Repo based context (fixes submodules etc)
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2
if: inputs.context-repository
with:
fetch-depth: 1

- name: Checkout external context
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2
if: inputs.context-repository
with:
repository: ${{ inputs.context-repository }}
Expand Down Expand Up @@ -194,7 +176,7 @@ jobs:

- name: Build and push Docker images
id: dockerBuild
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.9.0
with:
platforms: ${{ inputs.platforms }}
file: ${{ inputs.dockerfile }}
Expand All @@ -207,7 +189,7 @@ jobs:
cache-to: ${{ inputs.cache-to }}

# publish README on docker hub
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1

Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/operation-docker-sign.yml

This file was deleted.

Loading

0 comments on commit c9ee47e

Please sign in to comment.