mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-22 11:14:05 +00:00
refactor and run cleanup during pr check
This commit is contained in:
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -12,6 +12,11 @@ permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
jobs:
|
||||
cleanupaccounts:
|
||||
name: "Cleanup Test Database Accounts"
|
||||
needs: [playwright-tests]
|
||||
if: ${{ !cancelled() }}
|
||||
uses: ./.github/workflows/cleanup-base.yml
|
||||
codemetrics:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Log Code Metrics"
|
||||
@@ -251,3 +256,9 @@ jobs:
|
||||
name: html-report--attempt-${{ github.run_attempt }}
|
||||
path: playwright-report
|
||||
retention-days: 14
|
||||
|
||||
cleanupaccounts:
|
||||
name: "Cleanup Test Database Accounts"
|
||||
needs: [playwright-tests]
|
||||
if: ${{ !cancelled() }}
|
||||
uses: ./.github/workflows/cleanup-base.yml
|
||||
|
||||
29
.github/workflows/cleanup-base.yml
vendored
Normal file
29
.github/workflows/cleanup-base.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Cleanup Accounts
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cleanupaccounts:
|
||||
name: "Cleanup Test Database Accounts"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Az CLI login"
|
||||
uses: azure/login@v2
|
||||
with:
|
||||
client-id: ${{ secrets.E2E_TESTS_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.x
|
||||
|
||||
- run: npm ci
|
||||
- run: node utils/cleanupDBs.js
|
||||
22
.github/workflows/cleanup.yml
vendored
22
.github/workflows/cleanup.yml
vendored
@@ -17,23 +17,5 @@ permissions:
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
cleanupaccounts:
|
||||
name: "Cleanup Test Database Accounts"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: "Az CLI login"
|
||||
uses: azure/login@v1
|
||||
with:
|
||||
client-id: ${{ secrets.E2E_TESTS_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 18.x
|
||||
- run: npm ci
|
||||
- run: node utils/cleanupDBs.js
|
||||
name: "Cleanup Test Database Accounts"
|
||||
uses: ./.github/workflows/cleanup-base.yml
|
||||
|
||||
Reference in New Issue
Block a user