Skip to content

Commit

Permalink
Attempt to get CI to work
Browse files Browse the repository at this point in the history
  • Loading branch information
cloke committed Sep 9, 2024
1 parent 58717a1 commit be1e1b2
Show file tree
Hide file tree
Showing 14 changed files with 20,188 additions and 91 deletions.
26 changes: 26 additions & 0 deletions .github/actions/assert-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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: ember-scroll-modifiers/
setup:
run: pnpm build
cwd: ./ember-scroll-modifiers
# Will use once on TS
# expect: |
# dist/index.mjs
# dist/index.mjs.map
# ' >> assert-contents.config.yml
# npx assert-folder-contents
- name: Upload dist assets to cache
uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ env.dist }}
10 changes: 10 additions & 0 deletions .github/actions/download-built-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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@v4
with:
name: dist
path: ${{ env.dist }}
156 changes: 96 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,129 @@ on:
- main
- master
pull_request: {}
merge_group:
types: [checks_requested]

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
CI: true
dist: ember-scroll-modifiers/dist

jobs:
test:
name: "Tests"
install_dependencies:
name: Install
runs-on: ubuntu-latest
timeout-minutes: 10

cache-dependencies:
name: Cache dependencies
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Setup pnpm cache
uses: actions/cache@v4
- uses: wyvox/action-setup-pnpm@v3
with:
path: |
node_modules
*/node_modules
key: node_modules-${{runner.os}}-${{hashFiles('**/pnpm-lock.yaml')}}-v2
- name: Install dependencies
run: CI=true pnpm i --frozen-lockfile
node-version: 18.18.1

build:
name: Build
runs-on: ubuntu-20.04
lint:
name: Lint
runs-on: ubuntu-latest
needs: [install_dependencies]
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.18.1
- name: Lint
run: pnpm lint

- name: Run Tests
run: pnpm test:ember
build:
name: Build Tests
needs: [install_dependencies]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.18.1
- uses: ./.github/actions/assert-build

floating:
name: "Floating Dependencies"
default_tests:
name: Default Tests
timeout-minutes: 5
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.18.1
- uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember

floating_tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: volta-cli/action@v4
- name: Install Dependencies
run: pnpm install --no-lockfile
- name: Run Tests
run: pnpm test:ember
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.18.1
args: '--no-lockfile'
- uses: ./.github/actions/download-built-package
- run: pnpm i -f
- run: pnpm --filter test-app test:ember

try-scenarios:
try_scenarios:
name: ${{ matrix.try-scenario }}
timeout-minutes: 5
runs-on: ubuntu-latest
needs: "test"
timeout-minutes: 10
needs: [default_tests]

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-lts-5.4
- ember-test-helpers-v3
- ember-3.28
- ember-4.0.0
- ember-4.4
- ember-4.8
- ember-4.12
- ember-5.4
- ember-release
- ember-beta
- ember-canary
- embroider-safe
experimental: [false]
include:
- try-scenario: ember-beta
experimental: true
- try-scenario: ember-canary
experimental: true
- try-scenario: embroider-optimized
experimental: true
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: volta-cli/action@v4
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.18.1
- uses: ./.github/actions/download-built-package
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
working-directory: ./test-app
run: >-
node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
--skip-cleanup
# MeasureAssetSizes:
# name: Measure Asset Sizes
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@v4
# with:
# persist-credentials: false
# - uses: wyvox/action-setup-pnpm@v3
# with:
# node-version: 18.18.1
# - uses: ./.github/actions/download-built-package
# - name: measure asset sizes
# run: node ./dev/estimate-bytes/index.js
# - name: comment on PR
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# header: asset-sizes
# path: ./dev/estimate-bytes/comment.txt
13 changes: 6 additions & 7 deletions ember-scroll-modifiers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
},
"scripts": {
"build": "rollup --config",
"lint": "concurrently 'yarn:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'yarn:lint:*:fix' --names 'fix:'",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
Expand Down Expand Up @@ -65,12 +65,11 @@
"crypto"
],
"engines": {
"node": "16.* || >= 18"
},
"volta": {
"node": "18.20.4",
"yarn": "1.22.22"
"node": ">= 18",
"yarn": "use pnpm",
"npm": "use pnpm"
},
"packageManager": "[email protected]",
"ember": {
"edition": "octane"
},
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"repository": "",
"license": "MIT",
"author": "",
"workspaces": [
"ember-scroll-modifiers",
"test-app"
],
"scripts": {
"build": "pnpm --filter ember-scroll-modifiers run build",
"lint": "pnpm --filter ember-scroll-modifiers run lint",
Expand All @@ -21,5 +17,6 @@
},
"devDependencies": {
"concurrently": "^8.2.2"
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit be1e1b2

Please sign in to comment.