Skip to content

refactor(UI-1174): remove close icon session and event viewer component #5759

refactor(UI-1174): remove close icon session and event viewer component

refactor(UI-1174): remove close icon session and event viewer component #5759

name: Test, Build & Release
on: push
permissions:
contents: read
id-token: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_VERSION: "21.2.0"
SKIP_E2E_CHECK: ${{ !contains(github.event.head_commit.message, '[skip_e2e]') }}
jobs:
setup:
name: 🔧 Setup
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip_e2e]') }}
outputs:
cache-hit: ${{ steps.cache-node-modules.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
submodules: true
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Cache Playwright browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Update kittehub.zip
uses: ./.github/actions/update-kittehub
with:
pat-token: ${{ secrets.PAT_TOKEN }}
test:
name: 🧪 Testing ${{ matrix.browser }}
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
browser: ["Chrome", "Edge", "Firefox", "Safari"]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
submodules: true
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Restore cached dependencies
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Restore Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('package-lock.json') }}
- name: Setup test environment
uses: ./.github/actions/setup-test-env
with:
aws-role: ${{ secrets.AWS_GITHUB_ROLE }}
descope-project-id: ${{ secrets.VITE_DESCOPE_PROJECT_ID }}
browser: ${{ matrix.browser }}
- name: Run Playwright tests
env:
TESTS_JWT_AUTH_TOKEN: ${{ secrets.TESTS_JWT_AUTH_TOKEN }}
run: npx playwright test --project=${{ matrix.browser }}
- name: Upload test artifacts
if: always()
uses: ./.github/actions/upload-test-artifacts
with:
browser: ${{ matrix.browser }}
run-id: ${{ github.run_id }}
build:
needs: setup
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
submodules: true
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Restore cached dependencies
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Update kittehub.zip
uses: ./.github/actions/update-kittehub
with:
pat-token: ${{ secrets.PAT_TOKEN }}
- name: Build and verify
run: |
git submodule update --remote
npm run type-check
npm run lint:ci
npm run prettier:ci
npm run build
echo '!dist' >> .gitignore
- name: Upload Built Files
uses: actions/upload-artifact@v4
with:
name: built-files
path: dist
release:
needs: [build, test]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- uses: actions/download-artifact@v4
with:
name: built-files
path: ./dist
- name: Create ZIP of the dist directory
run: zip -r dist.zip dist
- name: Calculate SHA256 hash of dist.zip
run: |
SHA256=$(sha256sum dist.zip | awk '{ print $1 }')
echo "$SHA256" > dist.zip.sha256
echo "SHA256=$SHA256" >> $GITHUB_ENV
- name: Create release
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
HUSKY: 0
run: |
npm ci
npx semantic-release