Skip to content

Commit

Permalink
chore(ci): more e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed May 17, 2024
1 parent 1c6fcd7 commit ca7d425
Show file tree
Hide file tree
Showing 119 changed files with 110,293 additions and 7,747 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/test-archive-channel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test - archive-channel

on:
pull_request:
branches:
- main
paths:
- archive-channel/**
- .github/workflows/test-archive-channel.yml

concurrency:
group: test-archive-channel-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
WORDPRESS_CHART_VERSION: 22.2.8

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json
- name: build
run: make package-archive-channel

- name: create-release
id: create-release
uses: replicatedhq/compatibility-actions/create-release@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
yaml-dir: ./test/kots-install
promote-channel: ci-test-archive-channel-${{ github.sha }}

- name: test archive-channel
id: archive-channel
uses: ./archive-channel
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
channel-slug: ${{ steps.create-release.outputs.channel-slug }}

- name: archive-channel
if: always()
uses: replicatedhq/compatibility-actions/archive-channel@v1
continue-on-error: true # It could be that the channel is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
56 changes: 56 additions & 0 deletions .github/workflows/test-archive-customer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: test - archive-customer

on:
pull_request:
branches:
- main
paths:
- archive-customer/**
- .github/workflows/test-archive-customer.yml

concurrency:
group: test-archive-customer-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
WORDPRESS_CHART_VERSION: 22.2.8

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json
- name: build
run: make package-archive-customer

- name: create-customer
id: create-customer
uses: replicatedhq/replicated-actions/create-customer@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
customer-name: "CI Test Customer - ${{ github.ref_name }} - ${{ github.sha }}"
customer-email: ${{ github.sha }}@example.com
license-type: test

- name: test archive-customer
id: archive-customer
uses: ./archive-customer
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}

- name: archive-customer
if: always()
uses: replicatedhq/compatibility-actions/archive-customer@v1
continue-on-error: true # It could be that the channel is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}
1 change: 1 addition & 0 deletions .github/workflows/test-create-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-cluster/**
- .github/workflows/test-create-cluster.yml

concurrency:
group: test-create-cluster-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-create-customer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-customer/**
- .github/workflows/test-create-customer.yml

concurrency:
group: test-create-customer-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-release/**
- .github/workflows/test-create-release.yml

concurrency:
group: test-create-release-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-helm-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- helm-install/**
- .github/workflows/test-helm-install.yml

concurrency:
group: test-helm-install-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-kots-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- kots-install/**
- .github/workflows/test-kots-install.yml

concurrency:
group: test-kots-install-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-prepare-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- create-cluster/**
- helm-install/**
- kots-install/**
- .github/workflows/test-prepare-cluster.yml

concurrency:
group: test-prepare-cluster-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-remove-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- remove-cluster/**
- .github/workflows/test-remove-cluster.yml

concurrency:
group: test-remove-cluster-${{ github.head_ref }}
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ all: package-all readme-all

.PHONY: package-all
package-all: package-all-new \
package-archive-channel package-archive-customer package-create-object-store \
package-create-object-store \
package-create-postgres package-expose-port package-promote-release \
package-get-customer-instances package-report-compatibility-result package-upgrade-cluster

.PHONY: package-all-new
package-all-new: package-create-customer package-create-release \
package-all-new: package-archive-channel package-archive-customer \
package-create-customer package-create-release \
package-helm-install package-kots-install \
package-create-cluster package-remove-cluster package-prepare-cluster

Expand All @@ -25,14 +26,14 @@ package-prepare-cluster: package-main
cp -r dist prepare-cluster/

.PHONY: package-archive-channel
package-archive-channel:
rm -rf ./archive-channel/build ./archive-channel/dist
cd ./archive-channel && npm install && npm run build && npm run package
package-archive-channel: package-main
rm -rf ./archive-channel/dist
cp -r dist archive-channel/

.PHONY: package-archive-customer
package-archive-customer:
rm -rf ./archive-customer/build ./archive-customer/dist
cd ./archive-customer && npm install && npm run build && npm run package
rm -rf ./archive-customer/dist
cp -r dist archive-customer/

.PHONY: package-create-cluster
package-create-cluster: package-main
Expand Down
6 changes: 3 additions & 3 deletions archive-channel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ title: Archive Channel
---
graph LR
archive_channel["Archive Channel"]
app_slug["app-slug"]
api_token["api-token"]
app_slug["app-slug"]
channel_slug["channel-slug"]
app_slug ---> archive_channel
api_token ---> archive_channel
app_slug ---> archive_channel
channel_slug ---> archive_channel
```
## Inputs
| Name | Default | Required | Description |
| --- | --- | --- | --- |
| app-slug | | True | App Slug. |
| api-token | | True | API Token. |
| app-slug | | True | App Slug. |
| channel-slug | | True | The slug of the channel to archive. |

## Outputs
Expand Down
10 changes: 4 additions & 6 deletions archive-channel/action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: "Archive Channel"
description: "Archive a channel"
inputs:
app-slug:
description: "App Slug."
required: true
default: ""
api-token:
description: "API Token."
required: true
default: ""
app-slug:
description: "App Slug."
required: true
channel-slug:
description: "The slug of the channel to archive."
required: true
runs:
using: "node20"
main: "dist/index.js"
main: "index.js"
Loading

0 comments on commit ca7d425

Please sign in to comment.