Skip to content

Commit

Permalink
workflows: added general and pre-commit github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzovagliano committed Oct 22, 2024
1 parent 5cae23f commit 4648fa8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pre-Commit

on:
workflow_call:
inputs:
ref:
description: The reference to build
type: string
required: true

jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10.11"

- name: Run pre-commit
uses: pre-commit/[email protected]

20 changes: 20 additions & 0 deletions .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Pull request main

on:
pull_request_target:
branches: [main]
paths-ignore: [ "docs/**" ]

jobs:
test:
uses: ./.github/workflows/test-and-build.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
secrets: inherit

pre-commit:
uses: ./.github/workflows/pre-commit.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
secrets: inherit

12 changes: 6 additions & 6 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and Test
on:
push:
branches:
- main
pull_request_target:
branches:
- main
workflow_call:
inputs:
ref:
description: The reference to build
type: string
required: true

env:
AIRFLOW_HOME: /home/runner/work/workflows/workflows
Expand Down

0 comments on commit 4648fa8

Please sign in to comment.