Skip to content

CI

CI #2401

Workflow file for this run

name: CI
"on":
pull_request: null
push:
branches:
- main
schedule:
- cron: "0 3 * * 0 "
env:
CI: true
dist: ember-statechart-component/dist
jobs:
install_dependencies:
name: Install Dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
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:
- ./ember-statechart-component
- ./testing/ember-app
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
with:
version: 7.1.2
- name: Install Dependencies
run: pnpm install
- name: ESLint
run: cd ${{ matrix.path }} && pnpm run lint:js
commits:
name: Commit Messages
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: volta-cli/action@v2
- uses: wagoid/[email protected]
build:
name: Build Tests
needs:
- install_dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
with:
version: 7.1.2
- name: Install Dependencies
run: pnpm install
- name: Build and Assert Output
run: |-
echo 'target: ember-statechart-component/dist
setup:
run: pnpm build:js
cwd: ./ember-statechart-component
expect: |
index.js
index.js.map
index.d.ts
glint.d.ts
glint.d.ts.map
glint.js
glint.js.map
' >> assert-contents.config.yml
npx assert-folder-contents
- uses: actions/upload-artifact@v3
with:
name: dist
path: ${{ env.dist }}
tests:
name: Default Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
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 }}
- run: pnpm --filter ember-app run test:ember
floating-deps-tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
with:
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
try-scenarios:
name: ${{ matrix.ember-try-scenario }}
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- tests
strategy:
fail-fast: true
matrix:
ember-try-scenario:
- ember-4.0
- ember-4.4
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
with:
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 }}
- 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 }}
timeout-minutes: 5
runs-on: ubuntu-latest
continue-on-error: true
needs:
- build
strategy:
fail-fast: true
matrix:
typescript-scenario:
- [email protected]
- [email protected]
- [email protected]
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v2
- 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/[email protected]
with:
version: 7.1.2
- name: Install Dependencies (without frozen lockfile)
run: pnpm install --no-frozen-lockfile
- 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: ./testing/ember-app
- name: Type checking
run: >-
pnpm --filter ember-app exec tsc -v; pnpm --filter ember-app exec
glint --version; pnpm --filter ember-app exec glint
release:
name: Release
timeout-minutes: 5
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- tests
- typescript-compatibility
- try-scenarios
- floating-deps-tests
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: volta-cli/action@v2
- 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/[email protected]
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: Release
run: ./node_modules/.bin/semantic-release
working-directory: ./ember-statechart-component
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}