Skip to content

Commit

Permalink
Run examples in a single workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Sep 23, 2022
1 parent 2de3eb5 commit 1a31b59
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 84 deletions.
113 changes: 109 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,127 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: false

jobs:
buildAndLint:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/builder-vite
env:
wd: ./packages/builder-vite
steps:
- uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock`
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Build builder
run: yarn build
working-directory: ${{env.wd}}
- name: Archive built files
uses: actions/upload-artifact@v3
with:
name: builder-vite
path: |
./packages/builder-vite/dist
lint:
needs: build
runs-on: ubuntu-latest
env:
wd: ./packages/builder-vite
steps:
- uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock`
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Restore builder-vite dist
uses: actions/download-artifact@v3
with:
name: builder-vite
- name: Lint
run: yarn lint-ci
working-directory: ${{env.wd}}

exampleReact:
needs: build
env:
wd: ./examples/react
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock`
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Restore builder-vite dist
uses: actions/download-artifact@v3
with:
name: builder-vite
- name: Build example
run: yarn build-storybook
working-directory: ${{env.wd}}
- name: Test built example
run: yarn test-ci
working-directory: ${{env.wd}}
env:
# Workaround for https://github.com/facebook/jest/issues/8536
TEMP: ${{ runner.temp }}

exampleReactTS:
needs: build
env:
wd: ./examples/react-ts
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock`
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Restore builder-vite dist
uses: actions/download-artifact@v3
with:
name: builder-vite
- name: Build example
run: yarn build-storybook
working-directory: ${{env.wd}}
- name: Test built example
run: yarn test-ci
working-directory: ${{env.wd}}
env:
# Workaround for https://github.com/facebook/jest/issues/8536
TEMP: ${{ runner.temp }}
40 changes: 0 additions & 40 deletions .github/workflows/exampleReact.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/exampleReactTS.yml

This file was deleted.

0 comments on commit 1a31b59

Please sign in to comment.