From 24e06ae3bb5a8910f2dcaf92948df381c5304792 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:19:51 -0400 Subject: [PATCH 01/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 200 +++++++++---------- build/github-workflows/index.js | 27 --- build/github-workflows/package.json | 15 -- build/github-workflows/workflows/ci.yaml | 238 ----------------------- ci.yml | 62 ++++++ 5 files changed, 163 insertions(+), 379 deletions(-) delete mode 100644 build/github-workflows/index.js delete mode 100644 build/github-workflows/package.json delete mode 100644 build/github-workflows/workflows/ci.yaml create mode 100644 ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ac75d513..f2e0e296f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,11 @@ name: CI -on: +"on": pull_request: null push: branches: - main - - master schedule: - - cron: 0 3 * * 0 + - cron: "0 3 * * 0 " env: CI: true dist: ember-resources/dist @@ -22,10 +21,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies @@ -49,17 +47,15 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies run: pnpm install - name: ESLint run: pnpm run lint:js - working-directory: ${{ matrix.path }} commits: name: Commit Messages timeout-minutes: 5 @@ -70,7 +66,7 @@ jobs: fetch-depth: 0 - uses: volta-cli/action@v1 - uses: wagoid/commitlint-github-action@v4.1.12 - build_test: + build: name: Build Tests needs: - install_dependencies @@ -83,59 +79,39 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies run: pnpm install - name: Build and Assert Output - run: pnpm --filter ember-resources-build-test test + run: |- + echo 'target: ember-resources/dist + setup: + run: pnpm run build:js + cwd: ./ember-resources + expect: | + core + util + deprecated-in-v4 + index.js + index.js.map + index.d.ts + index.d.ts.map + ' >> assert-contents.config.yml + npx assert-folder-contents - uses: actions/upload-artifact@v3 with: name: dist path: ${{ env.dist }} - asset-sizes: - name: Measure Asset Sizes - timeout-minutes: 5 - runs-on: ubuntu-latest - if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' - needs: - - build_test - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 - with: - version: 7.1.2 - - name: Install Dependencies - run: pnpm install - - name: Download built package from cache - uses: actions/download-artifact@v3 - with: - name: dist - path: ${{ env.dist }} - - name: measure asset sizes - run: node ./build/estimate-bytes/index.js - - name: comment on PR - uses: marocchino/sticky-pull-request-comment@v2 - with: - path: ./build/estimate-bytes/comment.txt tests: name: Default Tests timeout-minutes: 5 runs-on: ubuntu-latest needs: - - build_test + - build steps: - uses: actions/checkout@v3 - uses: volta-cli/action@v1 @@ -143,46 +119,47 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download built package from cache + - name: Download build package from cache uses: actions/download-artifact@v3 with: name: dist path: ${{ env.dist }} - - run: pnpm --filter ember-app run ember:test + - run: pnpm --filter ember-app run test:ember floating-deps-tests: name: Floating Deps Test timeout-minutes: 5 runs-on: ubuntu-latest needs: - - build_test + - build steps: - uses: actions/checkout@v3 - uses: volta-cli/action@v1 - - uses: pnpm/action-setup@v2.2.2 + - name: Cache pnpm modules + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - - name: Install Dependencies + - name: Install Dependencies (without lockfile) run: rm pnpm-lock.yaml && pnpm install - - name: Download built package from cache - uses: actions/download-artifact@v3 - with: - name: dist - path: ${{ env.dist }} - - run: pnpm --filter ember-app run ember:test - try-scenarios: + - run: pnpm --filter ember-app run test:ember + ember-try: name: ${{ matrix.ember-try-scenario }} timeout-minutes: 10 runs-on: ubuntu-latest - needs: tests - strategy: + needs: + - tests + stategy: fail-fast: true matrix: ember-try-scenario: @@ -204,30 +181,30 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download built package from cache + - name: Download build package from cache uses: actions/download-artifact@v3 with: name: dist path: ${{ env.dist }} - name: test - working-directory: testing/ember-app - run: > + working-directory: ./testing/ember-app + run: >- node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup - typescript-compatibility: + typescript: name: ${{ matrix.typescript-scenario }} timeout-minutes: 5 runs-on: ubuntu-latest continue-on-error: true - needs: build_test + needs: + - build strategy: fail-fast: true matrix: @@ -240,42 +217,37 @@ jobs: - typescript@4.7 steps: - uses: actions/checkout@v3 - with: - fetch-depth: 1 - uses: volta-cli/action@v1 - name: Cache pnpm modules uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - - name: Install Dependencies + - name: Install Dependencies (without lockfile) run: rm pnpm-lock.yaml && pnpm install - - name: Download built package from cache + - name: Download build package from cache uses: actions/download-artifact@v3 with: name: dist path: ${{ env.dist }} - name: Update TS Version run: pnpm add --save-dev ${{ matrix.typescript-scenario }} - working-directory: testing/ember-app + working-directory: ./testing/ember-app - name: Type checking - run: | - pnpm --filter ember-app exec tsc -v + run: |- + pnpm --filter ember-app exec tsc -v; pnpm --filter ember-app exec tsc --build - publish: + release: name: Release timeout-minutes: 5 runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' needs: - tests - - typescript-compatibility - - try-scenarios - floating-deps-tests steps: - uses: actions/checkout@v3 @@ -286,15 +258,14 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.2 + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 with: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download built package from cache + - name: Download build package from cache uses: actions/download-artifact@v3 with: name: dist @@ -305,3 +276,34 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Measure Asset Sizes: + name: Measure Asset Sizes + needs: + - build + steps: + - uses: actions/checkout@v3 + - uses: volta-cli/action@v1 + - name: Cache pnpm modules + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + restore-keys: ${{ runner.os }}- + - uses: pnpm/action-setup@v2.2.1 + with: + version: 7.1.2 + - name: Install Dependencies + run: pnpm install + - name: Download build package from cache + uses: actions/download-artifact@v3 + with: + name: dist + path: ${{ env.dist }} + - name: measure asset sizes + run: node ./build/estimate-bytes/index.js + - name: comment on PR + uses: marocchino/sticky-pull-request-comment@v2 + with: + path: ./build/estimate-bytes/comment.txt + timeout-minutes: 5 + runs-on: ubuntu-latest diff --git a/build/github-workflows/index.js b/build/github-workflows/index.js deleted file mode 100644 index 5e612d1ac..000000000 --- a/build/github-workflows/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import fs from 'fs/promises'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import { parse, stringify } from 'yaml'; -import yaml from 'js-yaml'; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const targetDir = path.join(__dirname, '../..', '.github/workflows'); - -async function build() { - let ci = path.join(__dirname, 'workflows/ci.yaml'); - let info = await fs.readFile(ci, 'utf8'); - - // let parsed = parse(info, { keepSourceTokens: false, merge: true }); - // let output = stringify(parsed, { directives: false }); - let parsed = yaml.load(info, { json: true }); - let output = yaml.dump(parsed, { noRefs: true, quotingType: `"` }); - - // Remove anchors - parsed = parse(output); - Object.keys(parsed).forEach((key) => (key.startsWith('_') ? delete parsed[key] : 0)); - output = stringify(parsed, { directives: false }); - - await fs.writeFile(path.join(targetDir, 'ci.yml'), output); -} - -build(); diff --git a/build/github-workflows/package.json b/build/github-workflows/package.json deleted file mode 100644 index fcd601c02..000000000 --- a/build/github-workflows/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@nullvoxpopuli/github-workflows", - "private": true, - "type": "module", - "scripts": { - "build": "node ./index.js" - }, - "devDependencies": { - "yaml": "2.1.1", - "js-yaml": "4.1.0" - }, - "volta": { - "extends": "../../package.json" - } -} diff --git a/build/github-workflows/workflows/ci.yaml b/build/github-workflows/workflows/ci.yaml deleted file mode 100644 index 3b3db7bf4..000000000 --- a/build/github-workflows/workflows/ci.yaml +++ /dev/null @@ -1,238 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: - - main - - master - schedule: - - cron: "0 3 * * 0" # every Sunday at 3am - -env: - CI: true - dist: ember-resources/dist - -_ubuntu: &ubuntu - timeout-minutes: 5 - runs-on: ubuntu-latest - -_onlyPR: &onlyPR - if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' - -jobs: - install_dependencies: - name: Install Dependencies - <<: *ubuntu - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - &depCache - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - &pnpm - uses: pnpm/action-setup@v2.2.1 - with: - version: 7.1.2 - - &install - name: 'Install Dependencies' - run: pnpm install - - eslint: - name: ESLint - needs: ['install_dependencies'] - <<: *ubuntu - strategy: - fail-fast: true - matrix: - path: - - "./ember-resources" - - "./testing/ember-app" - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - name: ESLint - run: pnpm run lint:js - working-directory: ${{ matrix.path }} - - commits: - name: Commit Messages - <<: *ubuntu - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: volta-cli/action@v1 - - uses: wagoid/commitlint-github-action@v4.1.12 - - build_test: - name: Build Tests - needs: ['install_dependencies'] - <<: *ubuntu - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - name: 'Build and Assert Output' - run: pnpm --filter ember-resources-build-test test - - uses: actions/upload-artifact@v3 - with: - name: dist - path: ${{ env.dist }} - - asset-sizes: - name: Measure Asset Sizes - <<: [ *ubuntu, *onlyPR ] - needs: ['build_test'] - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - &getDist - name: 'Download built package from cache' - uses: actions/download-artifact@v3 - with: - name: dist - path: ${{ env.dist }} - - name: 'measure asset sizes' - run: node ./build/estimate-bytes/index.js - - name: comment on PR - uses: marocchino/sticky-pull-request-comment@v2 - with: - path: ./build/estimate-bytes/comment.txt - - - tests: - name: Default Tests - <<: *ubuntu - needs: ['build_test'] - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - *getDist - - run: pnpm --filter ember-app run ember:test - - floating-deps-tests: - name: Floating Deps Test - <<: *ubuntu - needs: ['build_test'] - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - # Same as Default tests, but: - # - no cache - # - "different" install command - - *pnpm - - name: 'Install Dependencies' - run: rm pnpm-lock.yaml && pnpm install - - *getDist - - run: pnpm --filter ember-app run ember:test - - try-scenarios: - name: "${{ matrix.ember-try-scenario }}" - <<: *ubuntu - timeout-minutes: 10 - needs: tests - - strategy: - fail-fast: true - matrix: - ember-try-scenario: - - ember-3.25 - - ember-3.26 - - ember-3.28 - - ember-4.0.0 - - ember-4.4 - - ember-concurrency-v1 - - ember-release - - ember-beta - - ember-canary - - embroider-safe - - embroider-optimized - steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - *getDist - - name: test - working-directory: testing/ember-app - run: | - node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup - - typescript-compatibility: - name: ${{ matrix.typescript-scenario }} - <<: *ubuntu - continue-on-error: true - needs: build_test - - strategy: - fail-fast: true - matrix: - typescript-scenario: - - typescript@4.2 - - typescript@4.3 - - typescript@4.4 - - typescript@4.5 - - typescript@4.6 - - typescript@4.7 - # - typescript@next - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - name: 'Install Dependencies' - run: rm pnpm-lock.yaml && pnpm install - - *getDist - - name: Update TS Version - run: pnpm add --save-dev ${{ matrix.typescript-scenario }} - working-directory: testing/ember-app - - name: Type checking - run: | - pnpm --filter ember-app exec tsc -v - pnpm --filter ember-app exec tsc --build - - - publish: - name: Release - <<: *ubuntu - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' - needs: [tests, typescript-compatibility, try-scenarios, floating-deps-tests] - - steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false - - uses: volta-cli/action@v1 - - *depCache - - *pnpm - - *install - - *getDist - - name: Release - run: ./node_modules/.bin/semantic-release - working-directory: ./ember-resources - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ci.yml b/ci.yml new file mode 100644 index 000000000..72eb0bf77 --- /dev/null +++ b/ci.yml @@ -0,0 +1,62 @@ +provider: github +template: "v2-addon" + +# --------------------- + +addon: './ember-resources' +testApp: './testing/ember-app' + +lint: + commits: true + eslint: + - "./ember-resources" + - "./testing/ember-app" + +build: + run: 'pnpm run build:js' + expect: | + core + util + deprecated-in-v4 + index.js + index.js.map + index.d.ts + index.d.ts.map + +support: + typescript: + - typescript@4.2 + - typescript@4.3 + - typescript@4.4 + - typescript@4.5 + - typescript@4.6 + - typescript@4.7 + + ember-try: + - ember-3.25 + - ember-3.26 + - ember-3.28 + - ember-4.0.0 + - ember-4.4 + - ember-concurrency-v1 + - ember-release + - ember-beta + - ember-canary + - embroider-safe + - embroider-optimized + +release: + semantic: true + +extra: + - name: Measure Asset Sizes + needs: ['build'] + steps: + # ember-ci-update inserts preamble here + - name: 'measure asset sizes' + run: node ./build/estimate-bytes/index.js + - name: comment on PR + uses: marocchino/sticky-pull-request-comment@v2 + with: + path: ./build/estimate-bytes/comment.txt + From de77c8938705425f3434820e210d31b71fa60251 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:26:51 -0400 Subject: [PATCH 02/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2e0e296f..e8cd3e198 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download build package from cache + - name: Download built package from cache uses: actions/download-artifact@v3 with: name: dist @@ -188,7 +188,7 @@ jobs: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download build package from cache + - name: Download built package from cache uses: actions/download-artifact@v3 with: name: dist @@ -229,7 +229,7 @@ jobs: version: 7.1.2 - name: Install Dependencies (without lockfile) run: rm pnpm-lock.yaml && pnpm install - - name: Download build package from cache + - name: Download built package from cache uses: actions/download-artifact@v3 with: name: dist @@ -265,7 +265,7 @@ jobs: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download build package from cache + - name: Download built package from cache uses: actions/download-artifact@v3 with: name: dist @@ -294,7 +294,7 @@ jobs: version: 7.1.2 - name: Install Dependencies run: pnpm install - - name: Download build package from cache + - name: Download built package from cache uses: actions/download-artifact@v3 with: name: dist From 6592870403030de3f2f12c9851b00486e113a7d8 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:27:59 -0400 Subject: [PATCH 03/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8cd3e198..4be760545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -47,7 +47,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -79,7 +79,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -119,7 +119,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -145,7 +145,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -181,7 +181,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -222,7 +222,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -258,7 +258,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: @@ -287,7 +287,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml')}} + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - uses: pnpm/action-setup@v2.2.1 with: From f6e4691f45d6503e2fd3e413b2dee82f85eeff56 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:32:45 -0400 Subject: [PATCH 04/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4be760545..469b6e316 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -49,7 +49,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -81,7 +81,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -121,7 +121,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -147,7 +147,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies (without lockfile) @@ -183,7 +183,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -224,7 +224,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies (without lockfile) @@ -260,7 +260,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies @@ -289,7 +289,7 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}- - - uses: pnpm/action-setup@v2.2.1 + - uses: pnpm/action-setup@v2.2.2 with: version: 7.1.2 - name: Install Dependencies From e391899af42a273a2f8879e6bc30f8cb25f7534d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:34:46 -0400 Subject: [PATCH 05/11] chore(internal): remove custom build test, it is now in CI only --- testing/build/expected-output-files.txt | 7 --- testing/build/package.json | 17 -------- testing/build/test.js | 58 ------------------------- 3 files changed, 82 deletions(-) delete mode 100644 testing/build/expected-output-files.txt delete mode 100644 testing/build/package.json delete mode 100644 testing/build/test.js diff --git a/testing/build/expected-output-files.txt b/testing/build/expected-output-files.txt deleted file mode 100644 index 5ebfcdb34..000000000 --- a/testing/build/expected-output-files.txt +++ /dev/null @@ -1,7 +0,0 @@ -core -util -deprecated-in-v4 -index.d.ts -index.d.ts.map -index.js -index.js.map diff --git a/testing/build/package.json b/testing/build/package.json deleted file mode 100644 index 7dab54b27..000000000 --- a/testing/build/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "ember-resources-build-test", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "test": "node ./test.js" - }, - "devDependencies": { - "chai": "^4.3.6", - "execa": "^6.1.0" - }, - "packageManager": "pnpm@7.1.2", - "volta": { - "extends": "../../package.json" - } -} diff --git a/testing/build/test.js b/testing/build/test.js deleted file mode 100644 index 28c8be615..000000000 --- a/testing/build/test.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -import fs from 'fs/promises'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import { execa } from 'execa'; -import { assert } from 'chai'; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const addonPath = path.join(__dirname, '..', '..', 'ember-resources'); - -async function main() { - await build(); - - let expected = await getExpected(); - let actual = await listFiles(); - - expected.sort(); - actual.sort(); - - console.debug({ expected, actual }); - - assert.deepEqual(actual, expected); -} - -async function build() { - if (process.env.CI) { - await execa('pnpm', ['run', 'build:js'], { - cwd: addonPath, - preferLocal: true, - stdio: 'inherit', - }); - - return; - } - - await execa('pnpm', ['run', 'build:js'], { cwd: addonPath, preferLocal: true }); -} - -async function getExpected() { - let expectedFile = await fs.readFile(path.join(__dirname, 'expected-output-files.txt')); - let expected = expectedFile.toString().split('\n'); - - return expected.filter(Boolean); -} - -async function listFiles(ofDir = path.join(addonPath, 'dist')) { - let read = await fs.readdir(ofDir, { withFileTypes: true }); - - // tslib has a hash that we can't know ahead of time - // and it provides decorator support - return read - .filter(Boolean) - .filter((file) => !file.name.startsWith('tslib')) - .map((item) => item.name); -} - -main(); From 6588fc9b368bc2dd3364b0d2e058f4089bc647ac Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:36:06 -0400 Subject: [PATCH 06/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 469b6e316..1fc96ebea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,7 +159,7 @@ jobs: runs-on: ubuntu-latest needs: - tests - stategy: + strategy: fail-fast: true matrix: ember-try-scenario: From 334257fbda25d8dfecbfee1fe8afb5445bac9f3d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:36:38 -0400 Subject: [PATCH 07/11] chore(monorepo): update ci:update command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3669d491f..7efc1a0e0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev:ember": "pnpm run --filter ember-app start --port 0", "dev:addon": "pnpm run --filter ember-resources start --no-watch.clearScreen", "dev:docs": "pnpm run --filter docs docs:watch --preserveWatchOutput", - "ci:update": "cd build/github-workflows && pnpm build", + "ci:update": "npx ember-ci-update", "build": "pnpm run --filter ember-resources build", "build:docs": "pnpm run --filter docs docs:collect" }, From a8954c635f9f823443e4dd79aa966f30c36a38a9 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:38:56 -0400 Subject: [PATCH 08/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fc96ebea..2f4fccb38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -276,7 +276,7 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - Measure Asset Sizes: + MeasureAssetSizes: name: Measure Asset Sizes needs: - build From ab267e25e0301cd92c5f675b89a6e4d26bf6bc4e Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:40:45 -0400 Subject: [PATCH 09/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f4fccb38..8de1b85cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,7 +198,7 @@ jobs: run: >- node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup - typescript: + typescript-compatibility: name: ${{ matrix.typescript-scenario }} timeout-minutes: 5 runs-on: ubuntu-latest @@ -248,6 +248,8 @@ jobs: if: github.ref == 'refs/heads/main' needs: - tests + - typescript-compatibility + - try-scenarios - floating-deps-tests steps: - uses: actions/checkout@v3 From b860c615d02b327be8c482121da01c5acd5c9c3f Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:46:35 -0400 Subject: [PATCH 10/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8de1b85cf..3c9c73292 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - name: Install Dependencies run: pnpm install - name: ESLint - run: pnpm run lint:js + run: cd ${{ matrix.path }} && pnpm run lint:js commits: name: Commit Messages timeout-minutes: 5 @@ -152,6 +152,11 @@ jobs: version: 7.1.2 - name: Install Dependencies (without lockfile) run: rm pnpm-lock.yaml && pnpm install + - name: Download built package from cache + uses: actions/download-artifact@v3 + with: + name: dist + path: ${{ env.dist }} - run: pnpm --filter ember-app run test:ember ember-try: name: ${{ matrix.ember-try-scenario }} From 606cc182d46e572a88010228da4460e877f7b586 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Mon, 30 May 2022 17:49:43 -0400 Subject: [PATCH 11/11] chore(internal): try new generated ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c9c73292..e893839a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,7 +158,7 @@ jobs: name: dist path: ${{ env.dist }} - run: pnpm --filter ember-app run test:ember - ember-try: + try-scenarios: name: ${{ matrix.ember-try-scenario }} timeout-minutes: 10 runs-on: ubuntu-latest