Skip to content

Commit e4adc09

Browse files
authored
[Chore][DEVX-540] Cleanup residue data (#1228)
* chore(commercetools-sdk-typescript): cleanup residue data - cleanup residue data and resources after testing * chore(commercetools-sdk-typescript): cleanup residue data - cleanup residue data and resources after testing * chore(commercetools-sdk-typescript): cleanup residue data - cleanup residue data and resources after testing * chore(commercetools-sdk-typescript): cleanup residue data - cleanup residue data and resources after testing * chore(commercetools-sdk-typescript): cleanup residue data - cleanup residue data and resources after testing
1 parent 2409ea3 commit e4adc09

File tree

3 files changed

+60
-11
lines changed

3 files changed

+60
-11
lines changed

.github/actions/cu/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Cleanup"
2+
description: "Cleanup created resources"
3+
4+
inputs:
5+
node-version:
6+
description: "Node.js version"
7+
required: false
8+
default: "18"
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Checkout commercetools-sunrise-data
14+
uses: actions/checkout@v4
15+
with:
16+
repository: commercetools/commercetools-sunrise-data
17+
path: sunrise-data
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ inputs.node-version }}
23+
24+
- name: Install dependencies
25+
working-directory: sunrise-data
26+
run: npm ci
27+
shell: bash
28+
29+
- name: Run cleanup
30+
working-directory: sunrise-data
31+
run: npm run clean:data
32+
shell: bash

.github/workflows/qa.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ permissions:
77
on:
88
push:
99
branches:
10-
- 'master'
11-
- '!changeset-release/**'
10+
- "master"
11+
- "!changeset-release/**"
1212

1313
pull_request:
14-
14+
1515
jobs:
1616
immutable-install:
1717
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
@@ -58,7 +58,7 @@ jobs:
5858
uses: ./.github/actions/ci
5959

6060
- name: TypeScript
61-
run: yarn typecheck
61+
run: yarn typecheck
6262

6363
testing:
6464
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
@@ -99,7 +99,7 @@ jobs:
9999
flags: test-coverage
100100

101101
regression-testing:
102-
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
102+
if: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/changeset-release/')}}
103103
name: Regression Testing
104104
needs: [testing]
105105
runs-on: ubuntu-latest
@@ -129,3 +129,20 @@ jobs:
129129

130130
- name: Integration tests
131131
run: yarn test
132+
133+
cleanup:
134+
name: cleanup resource
135+
runs-on: ubuntu-latest
136+
137+
# wait for test job
138+
needs: [testing, regression-testing]
139+
140+
# ALWAYS run, even if test failed
141+
if: always()
142+
143+
steps:
144+
- uses: actions/checkout@v4
145+
- uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f # v1.5
146+
with:
147+
secrets: ${{ toJSON(secrets) }}
148+
- uses: ./.github/actions/cu

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
permissions:
99
actions: write
1010
contents: write
11-
id-token: write # Required for npm trusted publishing (OIDC)
11+
id-token: write # Required for npm trusted publishing (OIDC)
1212

1313
jobs:
1414
release:
@@ -56,8 +56,8 @@ jobs:
5656
- name: Setup Node.js for npm publishing
5757
uses: actions/setup-node@v4
5858
with:
59-
node-version: '24'
60-
registry-url: 'https://registry.npmjs.org'
59+
node-version: "24"
60+
registry-url: "https://registry.npmjs.org"
6161

6262
- name: Building packages
6363
run: yarn build
@@ -77,11 +77,11 @@ jobs:
7777
with:
7878
publish: yarn changeset publish
7979
version: yarn changeset:version-and-format
80-
commit: 'ci(changesets): version packages'
80+
commit: "ci(changesets): version packages"
8181
env:
8282
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }}
8383
# Ensure npm uses OIDC authentication
84-
NPM_CONFIG_REGISTRY: 'https://registry.npmjs.org'
84+
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org"
8585
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8686

8787
- name: Dispatch repository event
@@ -130,7 +130,7 @@ jobs:
130130
if: steps.changesets.outputs.published == 'true'
131131
with:
132132
branch: after-release
133-
file_pattern: 'reference.txt'
133+
file_pattern: "reference.txt"
134134
commit_message: "chore: updating API ref SHA"
135135
commit_author: ct-changesets[bot] <${{ steps.get_app_user.outputs.email }}>
136136
commit_user_name: ct-changesets[bot]

0 commit comments

Comments
 (0)