Add volta config to keep our env consistent between machines #596
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
install_dependencies: | |
name: Install Dependencies | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
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 | |
eslint: | |
name: ESLint | |
needs: | |
- install_dependencies | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
path: | |
# - ./docs | |
- ./ember-headlessui | |
- ./test-app | |
# - ./test-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: ESLint | |
run: pnpm lint:js | |
working-directory: ${{ matrix.path }} | |
build_test: | |
name: Build Tests | |
needs: | |
- install_dependencies | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Uncomment when addon is converted to v2 format | |
# - 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: Build and Assert Output | |
# run: pnpm --filter build-test test | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: dist | |
# path: ${{ env.dist }} | |
tests: | |
name: Default Tests | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
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.1 | |
with: | |
version: 7.1.2 | |
- name: Install Dependencies | |
run: pnpm install | |
# monorepo prep | |
# - name: Download built package from cache | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: dist | |
# path: ${{ env.dist }} | |
- run: pnpm --filter test-app run test:ember | |
try-scenarios: | |
name: ${{ matrix.ember-try-scenario }} | |
runs-on: ubuntu-latest | |
needs: ['eslint', 'tests'] | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: true | |
matrix: | |
ember-try-scenario: | |
- ember-3-25 | |
- ember-lts-3-28 | |
- ember-4-0 | |
- ember-4-4 | |
- ember-release | |
- ember-beta | |
- ember-canary | |
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 | |
# monorepo prep | |
# - name: Download built package from cache | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: dist | |
# path: ${{ env.dist }} | |
- name: test | |
working-directory: test-app | |
run: > | |
node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} | |
--skip-cleanup | |
typescript-compatibility: | |
name: ${{ matrix.typescript-scenario }} | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
needs: build_test | |
strategy: | |
fail-fast: true | |
matrix: | |
typescript-scenario: | |
- 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 | |
- 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: rm pnpm-lock.yaml && pnpm install | |
# monorepo prep | |
# - name: Download built 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: test-app | |
- name: Type checking | |
run: | | |
pnpm --filter test-app exec tsc -v | |
pnpm --filter test-app exec tsc --build | |
# Temporariy while the addon is still a v1 addon. | |
# These checks will be handled by rollup in the future. | |
- name: Update TS Version | |
run: pnpm add --save-dev ${{ matrix.typescript-scenario }} | |
working-directory: 'ember-headlessui' | |
- name: Type checking | |
working-directory: 'ember-headlessui' | |
run: | | |
pnpm tsc -v | |
pnpm tsc --build | |