Skip to content
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

Renames module and performs some cleanup #22

Merged
merged 3 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 5 additions & 16 deletions .github/workflows/notify.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
name: Notify

on:
release:
types: [published]

jobs:
notify:
runs-on: ubuntu-latest

strategy:
matrix:
repo:
- cloud-native-toolkit/ibm-garage-iteration-zero
- cloud-native-toolkit/garage-terraform-modules

steps:
- name: Repository dispatch ${{ matrix.repo }}
uses: cloud-native-toolkit/action-repository-dispatch@main
with:
notifyRepo: ${{ matrix.repo }}
eventType: released
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
uses: cloud-native-toolkit/action-workflows/.github/workflows/notify.yaml@v1
secrets:
TOKEN: ${{ secrets.TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/publish-assets.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/publish-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Publish metadata

on:
release:
types:
- published

jobs:
publish-assets:
uses: cloud-native-toolkit/action-workflows/.github/workflows/publish-metadata.yaml@v1
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/verify-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Verify PR

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip ci' ) }}
uses: ./.github/workflows/verify-workflow.yaml
secrets:
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

verifyMetadata:
uses: cloud-native-toolkit/action-workflows/.github/workflows/verify-module-metadata.yaml@v1
47 changes: 47 additions & 0 deletions .github/workflows/verify-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Verify

# Controls when the action will run.
on:
workflow_call:
secrets:
IBMCLOUD_API_KEY:
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
runs-on: ubuntu-latest
container: quay.io/cloudnativetoolkit/terraform:v1.1

strategy:
matrix:
testcase:
- ocp4_latest
fail-fast: false
max-parallel: 1

env:
HOME: /home/devops

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Verify deploy on ${{ matrix.testcase }}
uses: cloud-native-toolkit/action-module-verify-deploy@main
with:
clusterId: ${{ matrix.testcase }}
validateDeployScript: .github/scripts/validate-deploy.sh
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

- name: Verify destroy on ${{ matrix.testcase }}
uses: cloud-native-toolkit/action-module-verify-destroy@main
if: ${{ always() }}
with:
clusterId: ${{ matrix.testcase }}
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
61 changes: 10 additions & 51 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,24 @@
name: Verify and release module
name: Verify

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip ci' ) }}
runs-on: ubuntu-latest
container: quay.io/cloudnativetoolkit/terraform:v1.1

strategy:
matrix:
platform: [ocp4_latest]
# max-parallel: 1
fail-fast: false

env:
HOME: /home/devops
uses: ./.github/workflows/verify-workflow.yaml
secrets:
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Verify deploy on ${{ matrix.platform }}
uses: ibm-garage-cloud/action-module-verify-deploy@main
with:
clusterId: ${{ matrix.platform }}
validateDeployScript: .github/scripts/validate-deploy.sh
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

- name: Verify destroy on ${{ matrix.platform }}
uses: ibm-garage-cloud/action-module-verify-destroy@main
if: ${{ always() }}
with:
clusterId: ${{ matrix.platform }}
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
verifyMetadata:
uses: cloud-native-toolkit/action-workflows/.github/workflows/verify-module-metadata.yaml@v1

release:
# if: ${{ github.event_name == 'push' }}
needs: verify
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter.yaml
publish: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
needs: [verify, verifyMetadata]
uses: cloud-native-toolkit/action-workflows/.github/workflows/release-module.yaml@v1
secrets:
TOKEN: ${{ secrets.TOKEN }}
Loading