Skip to content

Commit

Permalink
ci(github-actions): unify yaml style in github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Sep 27, 2023
1 parent ff8f54f commit 6886233
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 105 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/ci-astro-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
name: "Astro Deploy"
on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
git_rev:
description: 'The git revision to deploy'
description: "The git revision to deploy"
required: false
default: ''
default: ""

environment_to_deploy:
description: 'astro cloud deployment to deploy to'
description: "astro cloud deployment to deploy to"
required: true
type: choice
options:
Expand All @@ -23,16 +24,16 @@ on:
(e.g. "example_mssql_transform, example_load_file")
required: false
type: string
default: ''
default: ""
workflow_call:
inputs:
git_rev:
description: 'The git revision to deploy'
description: "The git revision to deploy"
type: string
required: false
default: ''
default: ""
environment_to_deploy:
description: 'astro cloud deployment to deploy to'
description: "astro cloud deployment to deploy to"
required: true
type: string
default: both
Expand All @@ -42,7 +43,7 @@ on:
(e.g. "example_mssql_transform, example_load_file")
required: false
type: string
default: ''
default: ""

jobs:
deploy-to-astro-sdk-integration-tests:
Expand All @@ -52,11 +53,11 @@ jobs:
uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml
with:
git_rev: ${{ inputs.git_rev }}
environment_to_deploy: 'astro-sdk-integration-tests'
environment_to_deploy: "astro-sdk-integration-tests"
secrets:
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
astronomer_key_id: ${{ secrets.ASTRO_KEY_ID }}
astronomer_key_secret: ${{ secrets.ASTRO_KEY_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down Expand Up @@ -85,11 +86,11 @@ jobs:
uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml
with:
git_rev: ${{ inputs.git_rev }}
environment_to_deploy: 'astro-sdk-integration-tests-on-KE'
environment_to_deploy: "astro-sdk-integration-tests-on-KE"
secrets:
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID_KE }}
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID_KE }}
astronomer_key_id: ${{ secrets.ASTRO_KEY_ID_KE }}
astronomer_key_secret: ${{ secrets.ASTRO_KEY_SECRET_KE }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Run benchmarks
on:
pull_request:
types:
- labeled
schedule:
- cron: '0 0 * * 1'
- cron: "0 0 * * 1"

# This allows a subsequently queued workflow run to interrupt and cancel previous runs
concurrency:
Expand Down
109 changes: 55 additions & 54 deletions .github/workflows/ci-python-sdk.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
name: Build and test astro Python SDK
on:
push:
branches: [ 'main', 'release-**' ]
branches: ["main", "release-**"]
paths:
- 'python-sdk/**'
- '.github/workflows/ci-python-sdk.yaml'
- "python-sdk/**"
- ".github/workflows/ci-python-sdk.yaml"
pull_request:
branches: [ 'main', 'release-**' ]
branches: ["main", "release-**"]
paths:
- 'python-sdk/**'
- '.github/workflows/ci-python-sdk.yaml'
- '*'
- "python-sdk/**"
- ".github/workflows/ci-python-sdk.yaml"
- "*"
# Run on PRs from forks
pull_request_target:
branches: [ 'main' ]
types: ['labeled']
branches: ["main"]
types: ["labeled"]
paths:
- 'python-sdk/**'
- '.github/workflows/ci-python-sdk.yaml'
- '*'
- "python-sdk/**"
- ".github/workflows/ci-python-sdk.yaml"
- "*"
release:
types: [ 'created' ]
types: ["created"]
defaults:
run:
working-directory: python-sdk
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: '.github/workflows/mlc_config.json'
config-file: ".github/workflows/mlc_config.json"

Type-Check:
if: github.event.action != 'labeled'
Expand All @@ -87,14 +88,14 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
.nox
key: ${{ runner.os }}-${{ hashFiles('python-sdk/pyproject.toml') }}
path: |
~/.cache/pip
.nox
key: ${{ runner.os }}-${{ hashFiles('python-sdk/pyproject.toml') }}
- run: pip3 install nox
- run: nox -s type_check

Expand All @@ -105,8 +106,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -170,8 +171,8 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -206,7 +207,7 @@ jobs:
Run-Unit-tests-Airflow-2-7:
strategy:
matrix:
version: [ '3.8', '3.9', '3.10', '3.11' ]
version: ["3.8", "3.9", "3.10", "3.11"]
if: >-
github.event_name == 'push' ||
(
Expand All @@ -233,7 +234,7 @@ jobs:
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.version }}
architecture: 'x64'
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -266,7 +267,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [ 1, 2, 3]
group: [1, 2, 3]
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -307,8 +308,8 @@ jobs:
if: github.event_name == 'pull_request_target'
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -362,7 +363,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [ 1, 2, 3]
group: [1, 2, 3]
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -403,8 +404,8 @@ jobs:
if: github.event_name == 'pull_request_target'
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -458,7 +459,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -499,8 +500,8 @@ jobs:
if: github.event_name == 'pull_request_target'
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -593,8 +594,8 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: '3.8'
architecture: 'x64'
python-version: "3.8"
architecture: "x64"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -626,15 +627,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [ '3.7', '3.8', '3.9', '3.10' ]
airflow: [ '2.2.5', '2.3', '2.4', '2.5', '2.6']
python: ["3.7", "3.8", "3.9", "3.10"]
airflow: ["2.2.5", "2.3", "2.4", "2.5", "2.6"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python }}'
architecture: 'x64'
python-version: "${{ matrix.python }}"
architecture: "x64"
- name: Get pip cache dir
id: pip-cache
run: |
Expand Down Expand Up @@ -669,7 +670,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"
- name: Install coverage
run: |
pip3 install coverage
Expand Down Expand Up @@ -732,18 +733,18 @@ jobs:
- Generate-Constraints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('python-sdk/pyproject.toml') }}
- run: pip3 install nox
- run: nox -s build
- run: nox -s release -- dist/*
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: "x64"
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('python-sdk/pyproject.toml') }}
- run: pip3 install nox
- run: nox -s build
- run: nox -s release -- dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/ci-rc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
if: |
always() &&
needs.check-airflow-provider-rc-release.result == 'success'
uses: ./.github/workflows/ci-astro-deploy.yml
uses: ./.github/workflows/ci-astro-deploy.yml
with:
environment_to_deploy: "both"
dags_to_trigger_after_deployment: "example_master_dag"
git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }}
environment_to_deploy: "both"
dags_to_trigger_after_deployment: "example_master_dag"
git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }}
secrets: inherit
Loading

0 comments on commit 6886233

Please sign in to comment.