From ce7f0c1e9e56eefb2aaa893069fbf88a4d23cd2f Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:45:04 -0500 Subject: [PATCH] Simplify CI (#533) * Simplify CI * Missed some try scenarios * Update lint --- .github/actions/assert-build/action.yml | 30 --------- .../actions/download-built-package/action.yml | 15 ----- .github/actions/setup-job/action.yml | 14 ----- .github/workflows/ci.yml | 62 ++++++------------- 4 files changed, 19 insertions(+), 102 deletions(-) delete mode 100644 .github/actions/assert-build/action.yml delete mode 100644 .github/actions/download-built-package/action.yml delete mode 100644 .github/actions/setup-job/action.yml diff --git a/.github/actions/assert-build/action.yml b/.github/actions/assert-build/action.yml deleted file mode 100644 index cd4bfcf6..00000000 --- a/.github/actions/assert-build/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build and Assert Assets Exists -description: Build the package and assert that file contents exist as we expect -runs: - using: "composite" - steps: - - name: Build and Assert Output - shell: bash - run: |- - echo ' - target: ./addon/dist - setup: - run: pnpm build - cwd: ./addon/ - expect: | - modifiers/sortable-group.js - modifiers/sortable-group.js.map - modifiers/sortable-handle.js - modifiers/sortable-handle.js.map - modifiers/sortable-item.js - modifiers/sortable-item.js.map - test-support/index.js - test-support/index.js.map - ' >> assert-contents.config.yml - npx assert-folder-contents - - - name: Upload dist assets to cache - uses: actions/upload-artifact@v3 - with: - name: dist - path: ./addon/dist diff --git a/.github/actions/download-built-package/action.yml b/.github/actions/download-built-package/action.yml deleted file mode 100644 index a33317d3..00000000 --- a/.github/actions/download-built-package/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Download built package from cache -description: Download built package from cache -runs: - using: "composite" - steps: - - name: Download built package from cache - uses: actions/download-artifact@v3 - with: - name: dist - path: ./addon/dist - - # https://github.com/pnpm/pnpm/issues/4965 - - name: 'Install dependencies' - shell: 'bash' - run: pnpm install --force diff --git a/.github/actions/setup-job/action.yml b/.github/actions/setup-job/action.yml deleted file mode 100644 index d3f9612d..00000000 --- a/.github/actions/setup-job/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Setup node and package manager -description: Setup node and install dependencies using the package manager -runs: - using: "composite" - steps: - - uses: pnpm/action-setup@v2.2.4 - with: - version: 7 - - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - - name: 'Install dependencies' - shell: 'bash' - run: pnpm install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 418b6664..e60f9ead 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,28 +8,17 @@ on: pull_request: {} concurrency: - group: ci-${{ github.head_ref || github.ref }} - cancel-in-progress: true + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: true jobs: + # Fills the dep cache so parallel jobs can start faster setup: - name: Setup + name: "Setup" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - uses: ./.github/actions/assert-build - - lint: - name: Lint - runs-on: ubuntu-latest - needs: [setup] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - name: Lint - run: pnpm lint + - uses: wyvox/action-setup-pnpm@v3 test: name: "Tests" @@ -38,26 +27,19 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - uses: ./.github/actions/download-built-package - - name: Run Tests - run: pnpm test:ember - working-directory: test-app + - uses: wyvox/action-setup-pnpm@v3 + - run: pnpm test - docs: - name: "Docs App" + lint: + name: "Lint" runs-on: ubuntu-latest - # This isn't a strict requirement, but it doesn't make - # sense to test the docs app if the main tests are not passing - needs: [test] + needs: [setup] steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - uses: ./.github/actions/download-built-package - - name: Run Tests - run: pnpm test:ember - working-directory: docs + - uses: wyvox/action-setup-pnpm@v3 + - name: Lint + run: pnpm lint floating: name: "Floating Dependencies" @@ -66,15 +48,10 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - uses: ./.github/actions/download-built-package - - name: Install Dependencies - run: | - rm pnpm-lock.yaml - pnpm install - - name: Run Tests - run: pnpm test:ember - working-directory: test-app + - uses: wyvox/action-setup-pnpm@v3 + with: + args: '--no-lockfile' + - run: pnpm test try-scenarios: name: ${{ matrix.try-scenario }} @@ -100,8 +77,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-job - - uses: ./.github/actions/download-built-package + - uses: wyvox/action-setup-pnpm@v3 - name: Run Tests - run: node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup + run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup working-directory: test-app