Skip to content

Commit

Permalink
Merge pull request #9 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Updates CI/CD infrastructure
  • Loading branch information
helrond authored Nov 27, 2024
2 parents 23ba2c2 + 71571c3 commit 74e0439
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 10 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: update dependencies
on:

schedule:
- cron: '0 0 1 * *'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
token: ${{ steps.app-token.outputs.token }}
ref: development
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip

- name: Install pre-commit and pip-tools
run: pip install pre-commit pip-tools

- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Update test requirements
run: pip-compile --upgrade test_requirements.in -o test_requirements.txt

- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ steps.app-token.outputs.token }}
base: development
branch: dependency-updates
delete-branch: true
title: Dependency Updates
commit-message: Dependency updates
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
- id: autopep8
args:
- --in-place
- --aggressive
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
Expand Down
4 changes: 2 additions & 2 deletions tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from unittest.mock import patch

import boto3
from moto import mock_ssm
from moto import mock_aws

from src.handle_digitized_image_notifications import (get_config,
lambda_handler,
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_structure_teams_message():
assert output == json.dumps(expected)


@mock_ssm
@mock_aws
def test_config():
ssm = boto3.client('ssm', region_name='us-east-1')
path = "/dev/digitized_av_trigger"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
boto3~=1.35
coverage~=7.6
moto~=5.0
pytest~=8.3
urllib3~=2.2
84 changes: 79 additions & 5 deletions tests/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
boto3~=1.26
coverage~=7.2
moto~=4.1
pytest~=7.2
urllib3~=1.26
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=tests/test_requirements.txt tests/test_requirements.in
#
boto3==1.35.70
# via
# -r tests/test_requirements.in
# moto
botocore==1.35.70
# via
# boto3
# moto
# s3transfer
certifi==2024.8.30
# via requests
cffi==1.17.1
# via cryptography
charset-normalizer==3.4.0
# via requests
coverage==7.6.8
# via -r tests/test_requirements.in
cryptography==43.0.3
# via moto
exceptiongroup==1.2.2
# via pytest
idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
jinja2==3.1.4
# via moto
jmespath==1.0.1
# via
# boto3
# botocore
markupsafe==3.0.2
# via
# jinja2
# werkzeug
moto==5.0.21
# via -r tests/test_requirements.in
packaging==24.2
# via pytest
pluggy==1.5.0
# via pytest
pycparser==2.22
# via cffi
pytest==8.3.3
# via -r tests/test_requirements.in
python-dateutil==2.9.0.post0
# via
# botocore
# moto
pyyaml==6.0.2
# via responses
requests==2.32.3
# via
# moto
# responses
responses==0.25.3
# via moto
s3transfer==0.10.4
# via boto3
six==1.16.0
# via python-dateutil
tomli==2.1.0
# via pytest
urllib3==2.2.3
# via
# -r tests/test_requirements.in
# botocore
# requests
# responses
werkzeug==3.1.3
# via moto
xmltodict==0.14.2
# via moto

0 comments on commit 74e0439

Please sign in to comment.