Skip to content

Examples

Examples #38

Workflow file for this run

name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ec2 creation config
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.NEW_GITHUB_TEST }}
filename: "small_test_github.yaml"
is-executable: false
working-directory: "./test_configs"
- name: aws creation
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.PERSONAL_TESTING }}
filename: "Jeremy_testing.pem"
is-executable: false
working-directory: "./test_configs"
- name: update
run: sudo apt-get update
- name: install awscli
run: sudo apt-get install -y awscli
- name: aws creds
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} &&
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} &&
aws configure set default.region us-west-2 &&
aws configure set output json
# - name: look at creds
# run: sudo cat /home/runner/.aws/credentials
# - name: look at config
# run: sudo cat /home/runner/.aws/config
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip install poetry==1.4.1
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Install poetry dependencies
run: |
python -m poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 easy_ec2 --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 easy_ec2 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m poetry run pytest tests/test_ec2.py -s