Skip to content

Commit

Permalink
chore: Update dry-run to use new build-package action
Browse files Browse the repository at this point in the history
- Use shared build-package action
- Update upload/download artifacts to v4
- Simplify unlock-dependencies custom action
  • Loading branch information
michaeldowseza committed Oct 23, 2024
1 parent a036dad commit 40e2efd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
10 changes: 2 additions & 8 deletions .github/actions/unlock-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@ name: Unlock Cloudscape dependencies in package-lock
description: Removes all @cloudscape-design dependencies from package-lock file

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- run: node ${{ github.action_path }}/index.js
shell: bash
using: 'node20'
main: 'index.js'
17 changes: 3 additions & 14 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- name: Unlock dependencies
uses: cloudscape-design/actions/.github/actions/unlock-dependencies@main
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm run test
if: ${{ github.repository != 'cloudscape-design/components' }}
- run: npm run test:unit
if: ${{ github.repository == 'cloudscape-design/components' }}
- name: Upload Artifacts
if: ${{ inputs.artifact-path != '' }}
uses: cloudscape-design/actions/.github/actions/upload-artifact@main
- name: Build Package
uses: cloudscape-design/actions/.github/actions/build-package@main
with:
path: ${{ inputs.artifact-path }}
name: ${{ inputs.artifact-name }}
package: ${{ github.repository }}
- name: Codecov
if: ${{ inputs.skip-codecov == false && always() }}
uses: codecov/codecov-action@v4
Expand Down
140 changes: 42 additions & 98 deletions .github/workflows/dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,50 @@ jobs:
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: build-tools
package: cloudscape-design/build-tools
buildJestPreset:
name: Build jest-preset
runs-on: ubuntu-latest
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: jest-preset
package: cloudscape-design/jest-preset
buildGlobalStyles:
name: Build global-styles
runs-on: ubuntu-latest
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: global-styles
package: cloudscape-design/global-styles
buildCollectionHooks:
name: Build collection-hooks
runs-on: ubuntu-latest
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: collection-hooks
package: cloudscape-design/collection-hooks
buildBrowserTestTools:
name: Build browser-test-tools
runs-on: ubuntu-latest
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: browser-test-tools
package: cloudscape-design/browser-test-tools
buildDocumenter:
name: Build documenter
runs-on: ubuntu-latest
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: documenter
package: cloudscape-design/documenter
buildTestUtils:
name: Build test-utils
runs-on: ubuntu-latest
needs: buildDocumenter
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: test-utils
download_dependencies: true
package: cloudscape-design/test-utils
buildThemingCore:
name: Build theming-core
runs-on: ubuntu-latest
Expand All @@ -81,9 +80,7 @@ jobs:
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: theming-core
artifact_path: theming-*.tgz
download_dependencies: true
package: cloudscape-design/theming-core
buildComponentToolkit:
name: Build component-toolkit
runs-on: ubuntu-latest
Expand All @@ -92,8 +89,7 @@ jobs:
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: component-toolkit
download_dependencies: true
package: cloudscape-design/component-toolkit
buildComponents:
name: Build components
runs-on: ubuntu-latest
Expand All @@ -110,11 +106,9 @@ jobs:
steps:
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: components
target_artifact: components-package
artifact_path: ./*.tgz
package: cloudscape-design/components
skip_tests: true
download_dependencies: true
cache_working_directory: true

buildBoardComponents:
name: Build board components
Expand All @@ -128,35 +122,25 @@ jobs:
- buildComponentToolkit
- buildComponents
steps:
- name: Download component artifacts
uses: actions/download-artifact@v3
with:
name: components-package
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: board-components
download_dependencies: true
package: cloudscape-design/board-components

buildCodeView:
name: Build code view components
runs-on: ubuntu-latest
needs:
- buildBuildTools
- buildBuildTools
- buildGlobalStyles
- buildBrowserTestTools
- buildDocumenter
- buildTestUtils
- buildComponentToolkit
- buildComponents
steps:
- name: Download component artifacts
uses: actions/download-artifact@v3
with:
name: components-package
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: code-view
download_dependencies: true
package: cloudscape-design/code-view

buildChatComponents:
name: Build chat components
Expand All @@ -170,110 +154,75 @@ jobs:
- buildComponentToolkit
- buildComponents
steps:
- name: Download component artifacts
uses: actions/download-artifact@v3
with:
name: components-package
- uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: chat-components
download_dependencies: true
package: cloudscape-design/chat-components

unitTest:
name: Components unit tests
runs-on: ubuntu-latest
needs:
- buildComponents
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Download component artifacts
uses: actions/download-artifact@v3
- name: Restore cached working directory
uses: actions/cache@v4
with:
name: components-package
- name: Unpack components artifacts
run: tar -xzf components-full.tgz
- name: Unit tests
key: cloudscape-design/components-${{ github.event.pull_request.head.sha || github.sha }}
path: ${{ github.workspace }}
- name: Run Unit Tests
run: npm run test:unit

integTestShards:
name: Components integration tests shard
integTest:
name: Components integration tests shards
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4]
needs:
- buildComponents
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Download component artifacts
uses: actions/download-artifact@v3
- name: Restore cached working directory
uses: actions/cache@v4
with:
name: components-package
- name: Unpack components artifacts
run: tar -xzf components-full.tgz
key: cloudscape-design/components-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
cloudscape-design/components-
path: ${{ github.workspace }}
- name: Integration tests
run: npm run test:integ -- --shard=${{ matrix.shard }}/${{ strategy.job-total }}

integTest:
name: Components integration tests
runs-on: ubuntu-latest
needs:
- integTestShards
steps:
- run: echo "Completed all integration tests"

motionTest:
name: Components motion tests
runs-on: ubuntu-latest
needs:
- buildComponents
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Download component artifacts
uses: actions/download-artifact@v3
- name: Restore cached working directory
uses: actions/cache@v4
with:
name: components-package
- name: Unpack components artifacts
run: tar -xzf components-full.tgz
key: cloudscape-design/components-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
cloudscape-design/components-
path: ${{ github.workspace }}
- name: Motion tests
run: npm run test:motion

a11yTest:
name: Components accessibility tests
runs-on: ubuntu-latest
needs:
- a11yTestShards
steps:
- run: echo "Completed all accessibility tests"

a11yTestShards:
name: Components accessibility tests shard
name: Components accessibility tests shards
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6]
needs:
- buildComponents
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Restore cached working directory
uses: actions/cache@v4
with:
node-version: 18
- name: Download component artifacts
uses: actions/download-artifact@v3
with:
name: components-package
- name: Unpack components artifacts
run: tar -xzf components-full.tgz
key: cloudscape-design/components-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
cloudscape-design/components-
path: ${{ github.workspace }}
- name: Accessibility tests
run: npm run test:a11y -- --shard=${{ matrix.shard }}/${{ strategy.job-total }}

Expand All @@ -291,12 +240,7 @@ jobs:
- buildGlobalStyles
- buildThemingCore
steps:
- name: Download component artifacts
uses: actions/download-artifact@v3
with:
name: components-package
- name: Build
uses: cloudscape-design/actions/.github/actions/build-package@main
with:
package: demos
download_dependencies: true
package: cloudscape-design/demos

0 comments on commit 40e2efd

Please sign in to comment.