Skip to content

Commit 9b5829d

Browse files
ostermanaknysh
andauthored
Add github action workflow (#30)
* 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]>
1 parent 8aea781 commit 9b5829d

File tree

11 files changed

+209
-78
lines changed

11 files changed

+209
-78
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Use this file to define individuals or teams that are responsible for code in a repository.
2+
# Read more: <https://help.github.com/articles/about-codeowners/>
3+
4+
* @cloudposse/engineering
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.
11+
12+
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
13+
14+
## Describe the Bug
15+
A clear and concise description of what the bug is.
16+
17+
## Expected Behavior
18+
A clear and concise description of what you expected to happen.
19+
20+
## Steps to Reproduce
21+
Steps to reproduce the behavior:
22+
1. Go to '...'
23+
2. Run '....'
24+
3. Enter '....'
25+
4. See error
26+
27+
## Screenshots
28+
If applicable, add screenshots or logs to help explain your problem.
29+
30+
## Environment (please complete the following information):
31+
32+
Anything that will help us triage the bug will help. Here are some ideas:
33+
- OS: [e.g. Linux, OSX, WSL, etc]
34+
- Version [e.g. 10.15]
35+
36+
## Additional Context
37+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
blank_issues_enabled: false
2+
3+
contact_links:
4+
5+
- name: Community Slack Team
6+
url: https://cloudposse.com/slack/
7+
about: |-
8+
Please ask and answer questions here.
9+
10+
- name: Office Hours
11+
url: https://cloudposse.com/office-hours/
12+
about: |-
13+
Join us every Wednesday for FREE Office Hours (lunch & learn).
14+
15+
- name: DevOps Accelerator Program
16+
url: https://cloudposse.com/accelerate/
17+
about: |-
18+
Own your infrastructure in record time. We build it. You drive it.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'feature request'
6+
assignees: ''
7+
8+
---
9+
10+
Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).
11+
12+
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
13+
14+
## Describe the Feature
15+
16+
A clear and concise description of what the bug is.
17+
18+
## Expected Behavior
19+
20+
A clear and concise description of what you expected to happen.
21+
22+
## Use Case
23+
24+
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.
25+
26+
## Describe Ideal Solution
27+
28+
A clear and concise description of what you want to happen. If you don't know, that's okay.
29+
30+
## Alternatives Considered
31+
32+
Explain what alternative solutions or features you've considered.
33+
34+
## Additional Context
35+
36+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/question.md

Whitespace-only changes.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## what
2+
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
3+
* Use bullet points to be concise and to the point.
4+
5+
## why
6+
* Provide the justifications for the changes (e.g. business case).
7+
* Describe why these changes were made (e.g. why do these commits fix the problem?)
8+
* Use bullet points to be concise and to the point.
9+
10+
## references
11+
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
12+
* Use `closes #123`, if this PR closes a GitHub issue `#123`
13+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Slash Command Dispatch
2+
on:
3+
issue_comment:
4+
types: [created]
5+
6+
jobs:
7+
slashCommandDispatch:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Slash Command Dispatch
13+
uses: cloudposse/actions/github/[email protected]
14+
with:
15+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
16+
reaction-token: ${{ secrets.GITHUB_TOKEN }}
17+
repository: cloudposse/actions
18+
commands: rebuild-readme, terraform-fmt
19+
permission: none
20+
issue-type: pull-request

.github/workflows/test.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: test
2+
on:
3+
# Open a PR to update README for all PRs (as necessary)
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
readme:
9+
runs-on: ubuntu-latest
10+
container: cloudposse/testing.cloudposse.co:latest
11+
env:
12+
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
13+
MAKE_INCLUDES: Makefile
14+
steps:
15+
16+
# Checkout the code from GitHub
17+
- name: "Checkout code"
18+
uses: actions/checkout@v2
19+
20+
# Initialize the build-harness with make target helpers
21+
- name: "Initialize build-harness"
22+
env:
23+
BUILD_HARNESS_BRANCH: master
24+
run: make init
25+
26+
# Run the bats tests from the test-harness against the module
27+
- name: "Test that README.md was generated from README.yaml"
28+
run: make readme/lint
29+
30+
bats:
31+
runs-on: ubuntu-latest
32+
container: cloudposse/testing.cloudposse.co:latest
33+
env:
34+
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
35+
MAKE_INCLUDES: Makefile
36+
steps:
37+
38+
# Checkout the code from GitHub
39+
- name: "Checkout code"
40+
uses: actions/checkout@v2
41+
42+
# Initialize the test-harness which has a library of bats tests
43+
- name: "Initialize test-harness"
44+
env:
45+
TEST_HARNESS_BRANCH: master
46+
run: make -C test/ clean init
47+
48+
# Run the bats tests from the test-harness against the module
49+
- name: "Test module with bats"
50+
run: make -C test/ module
51+
52+
# Run the bats tests from the test-harness against the example
53+
- name: "Test `examples/complete` with bats"
54+
run: make -C test/ examples/complete
55+
56+
terratest:
57+
runs-on: ubuntu-latest
58+
container: cloudposse/testing.cloudposse.co:latest
59+
env:
60+
PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
61+
MAKE_INCLUDES: Makefile
62+
steps:
63+
64+
# Checkout the code from GitHub
65+
- name: "Checkout code"
66+
uses: actions/checkout@v2
67+
68+
# Initialize the terratest go project
69+
- name: "Initialize terratest go project"
70+
run: make -C test/src clean init
71+
72+
# Run the terratest integration tests
73+
- name: "Test `examples/complete` with terratest"
74+
run: make -C test/src
75+
env:
76+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
77+
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

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

45-
# 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)
45+
# 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)
4646

4747

4848
This module creates an S3 bucket with support of versioning, encryption, ACL and bucket object policy.

README.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ github_repo: cloudposse/terraform-aws-s3-bucket
3333

3434
# Badges to display
3535
badges:
36-
- name: "Codefresh Build Status"
37-
image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-s3-bucket?type=cf-1"
38-
url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d13993639efa9451b1a2aa4"
36+
- name: "GitHub Action Tests"
37+
image: "https://github.com/cloudposse/terraform-aws-s3-bucket/workflows/test/badge.svg?branch=master"
38+
url: "https://github.com/cloudposse/terraform-aws-s3-bucket/actions"
3939
- name: "Latest Release"
4040
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-s3-bucket.svg"
4141
url: "https://github.com/cloudposse/terraform-aws-s3-bucket/releases/latest"

0 commit comments

Comments
 (0)