Skip to content

Commit

Permalink
feat: improve ci github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna committed Feb 10, 2024
1 parent d4fb621 commit 4b29020
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: echo "branch=$(cat branch)" >> "$GITHUB_OUTPUT"

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ steps.extract_branch.outputs.branch }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/ci-dbt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: CI dbt
on:
pull_request:
paths: ['**.sql', '**.yaml']
jobs:
lint:
name: Lint sql and yaml
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.10'
- name: Install requirements
run: pip install -r requirements-dev.txt
- name: Lint sql
run: sqlfmt --diff .
- name: Lint yaml
run: yamlfix --check .
15 changes: 15 additions & 0 deletions .github/workflows/ci-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: CI Docker
on:
pull_request:
paths: [Dockerfile]
jobs:
lint:
name: Lint dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run hadolint
uses: reviewdog/action-hadolint@v1
with:
reporter: github-pr-review
19 changes: 19 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: CI Pull Request
on:
pull_request:
jobs:
lint:
name: Lint pull request
runs-on: ubuntu-latest
steps:
- name: Lint pull request title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
19 changes: 5 additions & 14 deletions .github/workflows/ci.yaml → .github/workflows/ci-python.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: CI
name: CI Python

on:
pull_request:
paths: ['**.py']

jobs:
lint:
Expand All @@ -14,19 +15,9 @@ jobs:
python-version: ["3.11.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Lint source code
uses: chartboost/ruff-action@v1
- name: Lint pull request title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
test:
name: Test
runs-on: ${{ matrix.os }}
Expand All @@ -37,9 +28,9 @@ jobs:
python-version: ["3.11.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
architecture: ${{ matrix.arch }}
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Configure Git
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ steps.select_branch.outputs.branch }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: contains('AldemirLucas vncsna', github.actor)
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Import secrets
id: import_secrets
Expand Down

0 comments on commit 4b29020

Please sign in to comment.