This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
install pre-commit after activate virtual env #538
Workflow file for this run
This file contains 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
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
name: aws-deploy | |
on: | |
pull_request: | |
branches: ['*'] | |
push: | |
branches: ['*'] | |
concurrency: ci-${{ github.ref }} | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Create and activate virtual environment and install pre-commit | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
pip3 install pre-commit | |
- name: Run pre-commit | |
run: pre-commit run --all-files | |
- name: cdk synth | |
uses: youyo/aws-cdk-github-actions@v2 | |
with: | |
cdk_subcommand: 'synth' | |
actions_comment: false | |
cdk_args: '--context env=dev --debug' | |
- name: Install dependencies | |
run: pip install -r requirements.txt -r requirements-dev.txt | |
- name: Run unit tests | |
run: python -m pytest tests/ -s -v | |
cdk-deploy-dev: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
needs: tests | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Authenticate to AWS using GitHub OIDC | |
- name: Assume AWS Role | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::631692904429:role/sagebase-github-oidc-sage-bionetworks-schematic-infra | |
role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} | |
role-duration-seconds: 1200 | |
- name: cdk deploy to org-sagebase-dnt-dev (631692904429) | |
uses: youyo/aws-cdk-github-actions@v2 | |
with: | |
cdk_subcommand: 'deploy' | |
cdk_args: '--require-approval never --context env=dev --progress events --debug' | |
actions_comment: false | |
cdk-deploy-staging: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/staging' }} | |
needs: tests | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Assume AWS Role | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::878654265857:role/sagebase-github-oidc-sage-bionetworks-schematic-infra | |
role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} | |
role-duration-seconds: 1200 | |
- name: cdk deploy to org-sagebase-dca-prod (878654265857) | |
uses: youyo/aws-cdk-github-actions@v2 | |
with: | |
cdk_subcommand: 'deploy' | |
cdk_args: '--require-approval never --context env=staging --progress events --debug' | |
actions_comment: false | |
cdk-deploy-dev-refactor: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/dev-refactor' }} | |
needs: tests | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Authenticate to AWS using GitHub OIDC | |
- name: Assume AWS Role | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::631692904429:role/sagebase-github-oidc-sage-bionetworks-schematic-infra | |
role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} | |
role-duration-seconds: 1200 | |
- name: cdk deploy to org-sagebase-dnt-dev (631692904429) | |
uses: youyo/aws-cdk-github-actions@v2 | |
with: | |
cdk_subcommand: 'deploy' | |
cdk_args: '--require-approval never --context env=dev-refactor --progress events --debug' | |
actions_comment: false | |
cdk-deploy-prod: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/prod' }} | |
needs: tests | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Assume AWS Role | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::878654265857:role/sagebase-github-oidc-sage-bionetworks-schematic-infra | |
role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} | |
role-duration-seconds: 1200 | |
- name: cdk deploy to org-sagebase-dca-prod (878654265857) | |
uses: youyo/aws-cdk-github-actions@v2 | |
with: | |
cdk_subcommand: 'deploy' | |
cdk_args: '--require-approval never --context env=prod --progress events --debug' | |
actions_comment: false | |
trigger-profiler: | |
runs-on: ubuntu-latest | |
needs: cdk-deploy-dev | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.ACCESS_PROFILER }} | |
repository: Sage-Bionetworks/schematic_profiler | |
event-type: trigger-profiler |