Skip to content

Commit

Permalink
Add github action workflow (#30)
Browse files Browse the repository at this point in the history
* add workflow

* fix repo

* change image

* run docker iamge

* fix yaml

* login then test

* login then test

* pull private image

* use dockerhub

* init

* fix workflow rebuild readme

* checkout code

* add all tests

* refactor

* set default

* annotate workflow

* pass secrets

* annotate workflow

* Fix readme

* parameterize test image

* refactor into multiple jobs

* refactor and restore linting

* fix templates

* Update .github/workflows/slash-command-dispatch.yml

Co-authored-by: Andriy Knysh <[email protected]>

* Update .github/workflows/slash-command-dispatch.yml

Co-authored-by: Andriy Knysh <[email protected]>

* Update .github/workflows/test.yml

Co-authored-by: Andriy Knysh <[email protected]>

* Update .github/workflows/test.yml

Co-authored-by: Andriy Knysh <[email protected]>

* Update .github/workflows/test.yml

Co-authored-by: Andriy Knysh <[email protected]>

Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
osterman and aknysh authored Jun 7, 2020
1 parent 8aea781 commit 9b5829d
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 78 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use this file to define individuals or teams that are responsible for code in a repository.
# Read more: <https://help.github.com/articles/about-codeowners/>

* @cloudposse/engineering
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Bug
A clear and concise description of what the bug is.

## Expected Behavior
A clear and concise description of what you expected to happen.

## Steps to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Run '....'
3. Enter '....'
4. See error

## Screenshots
If applicable, add screenshots or logs to help explain your problem.

## Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:
- OS: [e.g. Linux, OSX, WSL, etc]
- Version [e.g. 10.15]

## Additional Context
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blank_issues_enabled: false

contact_links:

- name: Community Slack Team
url: https://cloudposse.com/slack/
about: |-
Please ask and answer questions here.
- name: Office Hours
url: https://cloudposse.com/office-hours/
about: |-
Join us every Wednesday for FREE Office Hours (lunch & learn).
- name: DevOps Accelerator Program
url: https://cloudposse.com/accelerate/
about: |-
Own your infrastructure in record time. We build it. You drive it.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: 'feature request'
assignees: ''

---

Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Feature

A clear and concise description of what the bug is.

## Expected Behavior

A clear and concise description of what you expected to happen.

## Use Case

Is your feature request related to a problem/challenge you are trying to solve? Please provide some additional context of why this feature or capability will be valuable.

## Describe Ideal Solution

A clear and concise description of what you want to happen. If you don't know, that's okay.

## Alternatives Considered

Explain what alternative solutions or features you've considered.

## Additional Context

Add any other context or screenshots about the feature request here.
Empty file.
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

## references
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a GitHub issue `#123`

20 changes: 20 additions & 0 deletions .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Slash Command Dispatch
on:
issue_comment:
types: [created]

jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Slash Command Dispatch
uses: cloudposse/actions/github/[email protected]
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: rebuild-readme, terraform-fmt
permission: none
issue-type: pull-request
77 changes: 77 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: test
on:
# Open a PR to update README for all PRs (as necessary)
pull_request:
types: [opened, synchronize, reopened]

jobs:
readme:
runs-on: ubuntu-latest
container: cloudposse/testing.cloudposse.co:latest
env:
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
MAKE_INCLUDES: Makefile
steps:

# Checkout the code from GitHub
- name: "Checkout code"
uses: actions/checkout@v2

# Initialize the build-harness with make target helpers
- name: "Initialize build-harness"
env:
BUILD_HARNESS_BRANCH: master
run: make init

# Run the bats tests from the test-harness against the module
- name: "Test that README.md was generated from README.yaml"
run: make readme/lint

bats:
runs-on: ubuntu-latest
container: cloudposse/testing.cloudposse.co:latest
env:
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
MAKE_INCLUDES: Makefile
steps:

# Checkout the code from GitHub
- name: "Checkout code"
uses: actions/checkout@v2

# Initialize the test-harness which has a library of bats tests
- name: "Initialize test-harness"
env:
TEST_HARNESS_BRANCH: master
run: make -C test/ clean init

# Run the bats tests from the test-harness against the module
- name: "Test module with bats"
run: make -C test/ module

# Run the bats tests from the test-harness against the example
- name: "Test `examples/complete` with bats"
run: make -C test/ examples/complete

terratest:
runs-on: ubuntu-latest
container: cloudposse/testing.cloudposse.co:latest
env:
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
MAKE_INCLUDES: Makefile
steps:

# Checkout the code from GitHub
- name: "Checkout code"
uses: actions/checkout@v2

# Initialize the terratest go project
- name: "Initialize terratest go project"
run: make -C test/src clean init

# Run the terratest integration tests
- name: "Test `examples/complete` with terratest"
run: make -C test/src
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

[![Cloud Posse][logo]](https://cpco.io/homepage)

# terraform-aws-s3-bucket [![Codefresh Build Status](https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-s3-bucket?type=cf-1)](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d13993639efa9451b1a2aa4) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-s3-bucket.svg)](https://github.com/cloudposse/terraform-aws-s3-bucket/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
# terraform-aws-s3-bucket [![GitHub Action Tests](https://github.com/cloudposse/terraform-aws-s3-bucket/workflows/test/badge.svg?branch=master)](https://github.com/cloudposse/terraform-aws-s3-bucket/actions) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-s3-bucket.svg)](https://github.com/cloudposse/terraform-aws-s3-bucket/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)


This module creates an S3 bucket with support of versioning, encryption, ACL and bucket object policy.
Expand Down
6 changes: 3 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ github_repo: cloudposse/terraform-aws-s3-bucket

# Badges to display
badges:
- name: "Codefresh Build Status"
image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-s3-bucket?type=cf-1"
url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d13993639efa9451b1a2aa4"
- name: "GitHub Action Tests"
image: "https://github.com/cloudposse/terraform-aws-s3-bucket/workflows/test/badge.svg?branch=master"
url: "https://github.com/cloudposse/terraform-aws-s3-bucket/actions"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-s3-bucket.svg"
url: "https://github.com/cloudposse/terraform-aws-s3-bucket/releases/latest"
Expand Down
74 changes: 0 additions & 74 deletions codefresh/test.yml

This file was deleted.

0 comments on commit 9b5829d

Please sign in to comment.