Skip to content

Commit

Permalink
second attempt and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner-ricks committed Oct 31, 2024
1 parent 7e83d15 commit 510a663
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 33 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/.pre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull Request

on:
workflow_call:
# pull_request:
# branches: [main]

jobs:
dependencies:
name: Pull Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setvars
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Clean Yarn cache
run: yarn cache clean
- name: Install dependencies
run: yarn

9 changes: 6 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
name: "CodeQL"

on:
workflow_call:
push:
branches: [ "main", "preview" ]
# branches: [ "main", "preview" ]
branches: [ "preview" ]
workflow_call:
# pull_request:
# branches: [ "main", "preview" ]
pull_request:
# branches: [ "main", "preview" ]
branches: [ "preview" ]
schedule:
- cron: '45 9 * * 4'

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Lint

on:
push:
branches: [main]
workflow_call:
# push:
# branches: [main]
# pull_request:
# branches: [main]

jobs:
format:
name: Prettier
runs-on: ubuntu-latest

steps:
# - uses: ./.github/actions/setvars

Expand All @@ -21,16 +21,17 @@ jobs:
node-version: '18'
cache: 'yarn'

- name: Clean Yarn cache
run: yarn cache clean
# - name: Clean Yarn cache
# run: yarn cache clean

- name: Install dependencies
run: yarn
# - name: Install dependencies
# run: yarn

- name: Run Prettier
run: yarn format

lint:
name: Lint
runs-on: ubuntu-latest
needs: format
steps:
Expand All @@ -43,8 +44,8 @@ jobs:
node-version: '18'
cache: 'yarn'

- name: Install dependencies
run: yarn
# - name: Install dependencies
# run: yarn

- name: Run Linter
run: yarn lint
13 changes: 10 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ on:
branches: [main]

jobs:
call-lint:
pre:
name: .Pre
uses: ./.github/workflows/.pre.yml

lint:
name: Lint
uses: ./.github/workflows/lint.yml

call-test:
test:
name: Test
if: ${{ always() }}
uses: ./.github/workflows/test.yml
needs: call-lint

call-codeql:
codeql:
name: CodeQL
if: ${{ always() }}
uses: ./.github/workflows/codeql.yml
needs: call-lint
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test

on:
push:
branches: [main]
workflow_call:
# push:
# branches: [main]
# pull_request:
# branches: [main]

Expand Down Expand Up @@ -33,42 +33,38 @@ on:
# SBL_PLAYWRIGHT_TEST_KC_ADMIN_GRANT_TYPE: "password"

jobs:
React:
react:
name: React
runs-on: ubuntu-latest

steps:
- uses: ./.github/actions/setvars

- uses: actions/checkout@v4

- uses: ./.github/actions/setvars
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'

- name: Clean Yarn cache
run: yarn cache clean
# - name: Clean Yarn cache
# run: yarn cache clean

- name: Install dependencies
run: yarn
# - name: Install dependencies
# run: yarn

- name: Run React tests
run: yarn test:ci
Cypress:
cypress:
name: Cypress
runs-on: ubuntu-latest

steps:
- uses: ./.github/actions/setvars

- uses: actions/checkout@v4

- uses: ./.github/actions/setvars
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'

- name: Install dependencies
run: yarn
# - name: Install dependencies
# run: yarn

- name: Run React tests
run: yarn test:e2e:ci

0 comments on commit 510a663

Please sign in to comment.