Skip to content

Commit

Permalink
feat(github): Add new workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Oct 23, 2024
1 parent 7b631f9 commit 6446990
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 279 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/branch_ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Workflow that runs on pushes to non-default branches

name: Non-Default Branch CI (Python)
name: Non-Default Branch Push CI (Python)

on:
push:
branches-ignore: ["main"]
branches-ignore: ['main']
paths-ignore: ['README.md']

# Specify concurrency such that only one workflow can run at a time
# * Different workflow files are not affected
Expand All @@ -24,6 +25,7 @@ permissions:

jobs:

# Job to run a linter and typechecker against the codebase
lint-typecheck:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -51,6 +53,8 @@ jobs:
- name: Typecheck package
run: uv run mypy .

# Job to run unittests
# * Produces a JUnit XML report that can be displayed in the GitHub UI
test-unit:
runs-on: ubuntu-latest
needs: lint-typecheck
Expand Down Expand Up @@ -119,8 +123,9 @@ jobs:
name: docs
path: docs

# Job for building container image
# * Builds and pushes an OCI Container image to the registry defined in the environment variables
# * Only runs if test job passes
# * Only runs if test and lint jobs pass
build-container:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -153,8 +158,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
tags: type=ref,event=branch

# Build and push the Container image to the registry
# * Creates a multiplatform-aware image
Expand Down
274 changes: 0 additions & 274 deletions .github/workflows/ci.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow that runs on closed PRs to the default branch

name: Default Branch PR Merged CI (Python)

on:
pull_request:
types: ["closed"]
branches: ["main"]

# Specify concurrency such that only one workflow can run at a time
# * Different workflow files are not affected
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false


jobs:

# Define an autotagger job that creates tags on changes to master
tag:
runs-on: ubuntu-latest
if: |
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version and push tag
uses: RueLaLa/auto-tagger@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
Loading

0 comments on commit 6446990

Please sign in to comment.