Files
actual/.github/workflows/build.yml

122 lines
3.3 KiB
YAML

name: Build
defaults:
run:
shell: bash
env:
CI: true
on:
push:
branches:
- master
pull_request:
jobs:
api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Build API
run: cd packages/api && yarn build
- name: Create package tgz
run: cd packages/api && yarn pack && mv package.tgz actual-api.tgz
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: actual-api
path: packages/api/actual-api.tgz
crdt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Build CRDT
run: cd packages/crdt && yarn build
- name: Create package tgz
run: cd packages/crdt && yarn pack && mv package.tgz actual-crdt.tgz
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: actual-crdt
path: packages/crdt/actual-crdt.tgz
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Build Web
run: ./bin/package-browser
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: actual-web
path: packages/desktop-client/build
- name: Upload Build Stats
uses: actions/upload-artifact@v3
with:
name: build-stats
path: packages/desktop-client/build-stats
size-compare:
runs-on: ubuntu-latest
needs: [web]
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: Wait for ${{github.base_ref}} build to succeed
uses: fountainhead/action-wait-for-check@v1.1.0
id: master-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: web
ref: ${{github.base_ref}}
- name: Report build failure
if: steps.master-build.outputs.conclusion == 'failure'
run: |
echo "Build failed on ${{github.base_ref}}"
exit 1
- name: Download build artifact from ${{github.base_ref}}
uses: dawidd6/action-download-artifact@v2
id: pr-build
with:
branch: ${{github.base_ref}}
workflow: build.yml
name: build-stats
path: base
- name: Download build artifact from PR
uses: actions/download-artifact@v2
with:
name: build-stats
path: head
- name: Strip content hashes from stats files
run: |
sed -i -E 's/\.[0-9a-f]{8,}\././g' ./head/*.json
sed -i -E 's/\.[0-9a-f]{8,}\././g' ./base/*.json
- uses: github/webpack-bundlesize-compare-action@v1.8.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
current-stats-json-path: ./head/desktop-client-stats.json
base-stats-json-path: ./base/desktop-client-stats.json
title: desktop-client
- uses: github/webpack-bundlesize-compare-action@v1.8.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
current-stats-json-path: ./head/loot-core-stats.json
base-stats-json-path: ./base/loot-core-stats.json
title: loot-core