Skip to content

Move CI from TravisCI to GitHub Actions #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CloudFormation Python Plugin CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
env:
AWS_DEFAULT_REGION: us-east-1
Comment on lines +14 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this environment variable used for anything btw?

Suggested change
env:
AWS_DEFAULT_REGION: us-east-1

runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious if we should use centos?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should test on macos-latest and windows-latest as well though

strategy:
matrix:
python: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade pip mypy 'attrs==19.2.0' -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install both plugin and support lib
run: |
pip install . src/
- name: pre-commit checks
run: |
pre-commit run --all-files
- name: End to End Resource Packaging Test Python 3.6
run: ./e2e-test.sh python36
- name: End to End Resource Packaging Test Python 3.7
run: ./e2e-test.sh python37
7 changes: 7 additions & 0 deletions e2e-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
DIR=$(mktemp -d)
cd "$DIR"
ls -la
cfn init -t AWS::Foo::Bar $1 --use-docker
ls -la
mypy src/aws_foo_bar/ --strict --implicit-reexport