adding entity counter recalculator #14
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
name: Test and push protagonist recalculator lambda functions | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
env: | |
NOW: | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: python -m pip install -r requirements.txt | |
- name: Run python tests | |
working-directory: ./entity-counter-recalculator | |
run: python -m unittest test_main.py | |
- name: Install zip | |
uses: montudor/action-zip@v1 | |
- name: Install minimal dependencies for package | |
run: python -m pip install --target ./package -r minimalRequirements.txt | |
- name: Zip packages | |
run: zip -qq -r my-dependencies.zip . -i packages/ | |
- name: Set current date as env variable | |
run: echo "NOW=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_ENV | |
- name: Zip output | |
working-directory: ./entity-counter-recalculator | |
run: zip -qq -r entity-counter-recalculator_${{ env.NOW }}.zip main.py app/ ../my-dependencies.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: entity-counter-recalculator | |
path: ./entity-counter-recalculator/entity-counter-recalculator_${{ env.NOW }}.zip |