This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
Repository is deprecated (#311) #1746
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: Build and Test | |
on: | |
push: | |
branches: [master, "*/*", "*/**", "fb-**"] | |
env: | |
NODE: 18 | |
CACHE_NAME_PREFIX: v1 | |
jobs: | |
build: | |
# ci can be skipped with `[skip ci]` prefix in message | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ env.NODE }}" | |
- name: Upgrade Yarn | |
run: npm install -g [email protected] | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Configure yarn cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Print Yarn cache size | |
run: du -d 0 -h ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
- name: Install dependencies | |
run: yarn install | |
- run: yarn install | |
- run: yarn run build:module | |
env: | |
CI: false # on true webpack breaks on warnings, and we have them a lot | |
NODE_ENV: 'production' | |
# run http-server with build in background (will be killed after job ends) | |
# do this only for master branch (so only for push event) | |
# because pr can contain unfinished job | |
- run: npx serve -l tcp://localhost:3000 build & | |
if: github.event_name == 'push' | |
- uses: actions/upload-artifact@master | |
if: ${{ failure() }} | |
with: | |
name: e2e output | |
path: e2e/output/ | |
# upload this build as artifact to current Action | |
- uses: actions/upload-artifact@master | |
with: | |
name: build ${{ github.event.pull_request.head.sha || github.sha }} | |
path: build/ |