Skip to content

Commit

Permalink
ci: adds dev branch actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yosefmaru committed Jul 16, 2024
1 parent 0f081e4 commit ed46788
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/ci_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
pull_request:
branches:
- dev

jobs:
linters:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[linters] --no-cache-dir
- name: Run linters
run: flake8 . && interrogate . && codespell src examples tests
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install graphviz libgraphviz-dev -y
python -m pip install -e .[dev] -e .[docs] --no-cache-dir
- name: Run tests and coverage
run: coverage run -m unittest discover && coverage report
2 changes: 1 addition & 1 deletion .github/workflows/tag_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
release_branches: ${{ inputs.default_branch }}
default_bump: patch
dry_run: true # Perform dryrun first to calculate new version
- name:
- name: Update changelog
run: echo "${{ steps.tag_version.outputs.changelog }}" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
- name: Commit changes
uses: EndBug/add-and-commit@v9
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/tag_and_publish_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tag and Publish - dev branch
on:
push:
branches:
- dev

jobs:
upload_schemas_dev:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
AWS_DATA_SCHEMA_ROLE: ${{ secrets.AWS_DATA_SCHEMA_ROLE_DEV }}
AWS_DATA_SCHEMA_BUCKET: ${{ vars.AWS_DATA_SCHEMA_BUCKET_DEV }}
AWS_REGION : ${{ vars.AWS_REGION_DEV }}
TEMP_DIR: 'temp_schemas'
S3_PREFIX: 'schemas'
steps:
- uses: actions/checkout@master
- name: Pull latest changes
run: git pull origin main
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_DATA_SCHEMA_ROLE }}
role-session-name: github-schema-upload-session
aws-region: ${{ env.AWS_REGION }}
- name: Create and upload schemas
run: |
python -m pip install -e .
python -m pip install pydantic==2.6.4
python -m aind_data_schema.utils.json_writer --output $TEMP_DIR --attach-version
python -m pip install awscli
aws s3 sync $TEMP_DIR s3://${AWS_DATA_SCHEMA_BUCKET}/$S3_PREFIX

0 comments on commit ed46788

Please sign in to comment.