Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup GitHub Actions #3073

Merged
merged 17 commits into from
Sep 3, 2024
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
Loading