Add entry for testing #155
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CICD Prod | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
packages: read | |
statuses: write | |
id-token: write | |
env: | |
_BUCKET: ${{ secrets.BUCKET }} | |
_ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
_PIPELINE_REPO: ${{ secrets.PIPELINE_REPO }} | |
jobs: | |
ci: | |
permissions: write-all | |
name: Check code quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Super-linter | |
uses: super-linter/super-linter@v6.6.0 | |
env: | |
VALIDATE_PYTHON: true | |
VALIDATE_PYTHON_BLACK: true | |
VALIDATE_PYTHON_FLAKE8: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test: | |
needs: [ci] | |
name: Integration Tests | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'Check Vertex Pipeline: Beans' | |
uses: dorny/paths-filter@v2.2.1 | |
id: vertex-pipeline-beans | |
with: | |
filters: | | |
src: | |
- 'vertex-pipelines/pipelines/beans/**' | |
- name: 'Check Vertex Pipelin: Houses' | |
uses: dorny/paths-filter@v2.2.1 | |
id: vertex-pipeline-houses | |
with: | |
filters: | | |
src: | |
- 'vertex-pipelines/pipelines/houses/**' | |
- name: 'Compile Pipeline: Beans' | |
if: steps.vertex-pipeline-beans.outputs.src == 'true' | |
run: | | |
pip install --upgrade pip | |
pip install -r vertex-pipelines/requirements.txt | |
python3 -B vertex-pipelines/pipelines/beans/beans_pipeline.py --compile | |
- name: 'Compile Pipeline: Houses' | |
if: steps.vertex-pipeline-houses.outputs.src == 'true' | |
run: | | |
pip install --upgrade pip | |
pip install -r vertex-pipelines/requirements.txt | |
python3 -B vertex-pipelines/pipelines/houses/houses_pipeline.py --compile | |
cd: | |
needs: [ci, test] | |
permissions: write-all | |
name: Deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'GCP Auth' | |
uses: 'google-github-actions/auth@v0.4.0' | |
with: | |
project_id: 'gsd-ai-mx-ferneutron' | |
workload_identity_provider: 'projects/435551770080/locations/global/workloadIdentityPools/mlops-identity/providers/mlops-provide-v2' | |
service_account: 'workshop@gsd-ai-mx-ferneutron.iam.gserviceaccount.com' | |
- name: 'Check Vertex Pipeline: Beans' | |
uses: dorny/paths-filter@v2.2.1 | |
id: vertex-pipeline-beans | |
with: | |
filters: | | |
src: | |
- 'vertex-pipelines/pipelines/beans/**' | |
- name: 'Check Vertex Pipeline: Houses' | |
uses: dorny/paths-filter@v2.2.1 | |
id: vertex-pipeline-houses | |
with: | |
filters: | | |
src: | |
- 'vertex-pipelines/pipelines/houses/**' | |
- name: 'Check Cloud Function: Beans' | |
uses: dorny/paths-filter@v2.2.1 | |
id: cloud-function-beans | |
with: | |
filters: | | |
src: | |
- 'cloud-functions/beans/**' | |
- name: 'Check Cloud Function: Houses' | |
uses: dorny/paths-filter@v2.2.1 | |
id: cloud-function-houses | |
with: | |
filters: | | |
src: | |
- 'cloud-functions/houses/**' | |
- name: 'Submit Vertex Pipeline: Houses' | |
if: steps.vertex-pipeline-houses.outputs.src == 'true' | |
run: gcloud builds submit . --config cloud-build/vertex-pipeline.yaml --substitutions _BUCKET=${{ secrets.BUCKET }},_ENVIRONMENT=prod,_PIPELINE_REPO=${{ secrets.PIPELINE_REPO }},_PIPELINE=houses | |
- name: 'Submit Vertex: Beans' | |
if: steps.vertex-pipeline-beans.outputs.src == 'true' | |
run: gcloud builds submit . --config cloud-build/vertex-pipeline.yaml --substitutions _BUCKET=${{ secrets.BUCKET }},_ENVIRONMENT=prod,_PIPELINE_REPO=${{ secrets.PIPELINE_REPO }},_PIPELINE=beans | |
- name: 'Submit Cloud Function: Beans' | |
if: steps.cloud-function-beans.outputs.src == 'true' | |
run: gcloud beta builds submit . --config cloud-build/cloud-function.yaml --substitutions _PIPELINE=beans,_LOCATION=us-central1 | |
- name: 'Submit Cloud Function: Houses' | |
if: steps.cloud-function-houses.outputs.src == 'true' | |
run: gcloud beta builds submit . --config cloud-build/cloud-function.yaml --substitutions _PIPELINE=houses,_LOCATION=us-central1 |