Skip to content

Commit

Permalink
update ci and release
Browse files Browse the repository at this point in the history
  • Loading branch information
cayod committed Oct 23, 2023
1 parent 8ff8bfa commit 71d47cb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
79 changes: 41 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,57 @@ on:
- master

jobs:
# pre-commit:
# runs-on: ubuntu-latest
# if: >-
# github.event.pull_request.merged == false &&
# github.event.pull_request.state == 'open'
pre-commit:
runs-on: ubuntu-latest
if: >-
github.event.pull_request.merged == false &&
github.event.pull_request.state == 'open'
# steps:
# - uses: actions/checkout@v3
steps:
- uses: actions/checkout@v3

# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.8
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

# - uses: pre-commit/[email protected]
- uses: pre-commit/[email protected]

# tests:
# runs-on: ubuntu-latest
# needs: [pre-commit]
tests:
runs-on: ubuntu-latest
needs: [pre-commit]

# steps:
# - uses: actions/checkout@v3
steps:
- uses: actions/checkout@v3

# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.8
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

# - name: Install dependencies
# run: |
# cat airflow_variables_dev.json | sed -e s/\\/home\\/airflow\\/gcs\\/dags\\/// > airflow_variables_ci.json
# python -m pip install --upgrade pip
# pip install -r requirements-ci.txt
- name: Install dependencies
run: |
cat airflow_variables_dev.json | sed -e s/\\/home\\/airflow\\/gcs\\/dags\\/// > airflow_variables_ci.json
python -m pip install --upgrade pip
pip install -r requirements-ci.txt
# - name: Init Airflow SQLite database
# run: airflow db init
- name: Init Airflow SQLite database
run: airflow db init

# - name: Import Airflow variables
# run: airflow variables import airflow_variables_ci.json
- name: Import Airflow variables
run: airflow variables import airflow_variables_ci.json

# - name: Authenticate to test-hubble GCP
# uses: google-github-actions/auth@v1
# with:
# credentials_json: "${{ secrets.CREDS_TEST_HUBBLE }}"
- name: Authenticate to test-hubble GCP
uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.CREDS_TEST_HUBBLE }}"

# - name: Pytest
# run: pytest dags/
- name: Pytest
run: pytest dags/

deploy-to-dev:
runs-on: ubuntu-latest
# needs: [tests]
needs: [tests]
# deploy to dev occurs every time
# someone submits a pr targeting `master`
# from a branch at `stellar/stellar-etl-airflow` repo
Expand Down Expand Up @@ -102,7 +102,10 @@ jobs:
COMPOSER_ENVIRONMENT: hubble-1pt5-dev
LOCATION: us-central1
with:
args: components install kubectl && gcloud composer environments run $COMPOSER_ENVIRONMENT --location $LOCATION variables import -- gcsfuse/variables.json
args: >
components install kubectl && gcloud composer environments \
run $COMPOSER_ENVIRONMENT --location $LOCATION \
variables import -- gcsfuse/variables.json
promote-to-prod:
runs-on: ubuntu-latest
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ jobs:
BUCKET: us-central1-hubble-2-d948d67b-bucket

- name: Update Airflow variables
run: >
gcloud composer environments run $COMPOSER_ENVIRONMENT
--location $LOCATION
variables import -- gcsfuse/variables.json
uses: actions-hub/gcloud@master
env:
COMPOSER_ENVIRONMENT: hubble-2-d948d67b
PROJECT_ID: hubble-2-d948d67b
APPLICATION_CREDENTIALS: "${{ secrets.CREDS_TEST_HUBBLE }}"
COMPOSER_ENVIRONMENT: hubble-2
LOCATION: us-central1
with:
args: >
components install kubectl && gcloud composer environments \
run $COMPOSER_ENVIRONMENT --location $LOCATION \
variables import -- gcsfuse/variables.json

0 comments on commit 71d47cb

Please sign in to comment.