diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a14a18..208d254 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,3 +40,32 @@ jobs: with: name: coverage path: coverage/ + + e2e: + name: E2E tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup node_modules cache + uses: actions/cache@v1 + env: + cache-name: yarn + with: + path: .yarn + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + + - name: Install yarn + run: hash yarn 2>/dev/null || curl -s -L https://yarnpkg.com/install.sh | sudo node + + - name: Install dependencies and build packages + run: | + yarn config set cache-folder $(pwd)/.yarn + yarn install --frozen-lockfile + yarn run build + + - name: Run unit tests + run: yarn test:e2e diff --git a/examples/css-modules/rollup.config.js b/examples/css-modules/rollup.config.js index 810fee6..bfcfc03 100644 --- a/examples/css-modules/rollup.config.js +++ b/examples/css-modules/rollup.config.js @@ -1,6 +1,6 @@ import VuePlugin from 'rollup-plugin-vue' -import postcss from 'rollup-plugin-postcss' -import resolve from '@rollup/plugin-node-resolve' +import PostCSS from 'rollup-plugin-postcss' +import NodeResolve from '@rollup/plugin-node-resolve' /** @type {import('rollup').RollupOptions[]} */ const config = [ @@ -12,15 +12,19 @@ const config = [ sourcemap: 'inline', }, plugins: [ - resolve(), + // Resolve packages from `node_modules` e.g. `style-inject` module + // used by `rollup-plugin-postcss` to inline CSS. + NodeResolve(), VuePlugin(), - postcss({ + // Process only `