Skip to content

Commit

Permalink
Cleanup GitHub Actions (#3073)
Browse files Browse the repository at this point in the history
Signed-off-by: James Talton <[email protected]>
  • Loading branch information
jamestalton authored Sep 3, 2024
1 parent 1edd70d commit 96dcf0b
Show file tree
Hide file tree
Showing 32 changed files with 116 additions and 999 deletions.
179 changes: 0 additions & 179 deletions .github/workflows/awx-e2e.yml

This file was deleted.

120 changes: 0 additions & 120 deletions .github/workflows/awx-update-server.yml

This file was deleted.

57 changes: 37 additions & 20 deletions .github/workflows/component.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
name: Pull Request
name: Component

on:
workflow_call:
secrets:
COMPONENT_PROJECT_ID:
required: true
COMPONENT_RECORD_KEY:
inputs:
directory:
description: 'The base directory to search for .cy.tsx files'
required: true
type: string

jobs:
generate-matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.MATRIX }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate matrix
id: set-matrix
run: |
BASE_DIR="${{ inputs.directory }}"
matrix=$(find "$BASE_DIR" -type f -name '*.cy.tsx' -exec dirname {} \; | sed "s|^$BASE_DIR/||" | awk -F'/' '{print $1}' | sort -u | jq -R . | jq -s -c .)
echo "Matrix value: $matrix"
echo "MATRIX=$matrix" >> $GITHUB_OUTPUT
component:
name: Component
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
fail-fast: true
fail-fast: false
matrix:
task: [
"awx:access",
"awx:administration",
"awx:common",
"awx:overview",
"awx:resources",
"awx:views",
"eda",
"hub",
"common",
"framework"
]
directory: ${{ fromJson(needs.generate-matrix.outputs.MATRIX) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: PreCache
run: npm version 0.0.0 --no-git-tag-version

- name: Cache dependencies
id: cache
uses: actions/cache@v4
Expand All @@ -45,8 +56,14 @@ jobs:
./node_modules
/home/runner/.cache/Cypress
key: modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Run Cypress component tests ${{ matrix.task }}
run: npm run component:${{ matrix.task }}

- name: Cypress
uses: cypress-io/github-action@v6
with:
install: false
component: true
spec: ${{ inputs.directory }}/${{ matrix.directory }}/**/*.cy.tsx
Loading

0 comments on commit 96dcf0b

Please sign in to comment.