2023-06-22 15:38:12 -07:00
|
|
|
name: Build, unit test and lint branch
|
2019-12-24 16:25:44 -08:00
|
|
|
|
2024-08-22 02:41:53 -07:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
- '!release/*'
|
2019-12-24 16:25:44 -08:00
|
|
|
|
|
|
|
jobs:
|
2024-06-13 04:10:51 -07:00
|
|
|
install-and-build:
|
2023-03-02 07:50:21 -08:00
|
|
|
name: Install & Build
|
2019-12-24 16:25:44 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-01-26 02:26:30 -08:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
2023-10-13 01:44:26 -07:00
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2024-02-02 00:47:58 -08:00
|
|
|
- run: corepack enable
|
2024-05-24 03:32:50 -07:00
|
|
|
- uses: actions/setup-node@v4.0.2
|
2022-08-19 06:34:02 -07:00
|
|
|
with:
|
2024-05-24 03:32:50 -07:00
|
|
|
node-version: 20.x
|
2023-03-02 07:50:21 -08:00
|
|
|
cache: pnpm
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2024-07-05 08:43:52 -07:00
|
|
|
- name: Setup build cache
|
|
|
|
uses: rharkor/caching-for-turbo@v1.5
|
|
|
|
|
2022-10-10 10:50:26 -07:00
|
|
|
- name: Build
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm build
|
2022-10-10 10:50:26 -07:00
|
|
|
|
2024-09-17 05:10:22 -07:00
|
|
|
- name: Run formatcheck
|
|
|
|
run: pnpm format:check
|
|
|
|
|
2024-06-05 00:50:48 -07:00
|
|
|
- name: Run typecheck
|
|
|
|
run: pnpm typecheck
|
|
|
|
|
2023-03-02 07:50:21 -08:00
|
|
|
- name: Cache build artifacts
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/cache/save@v4.0.0
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
2023-08-22 02:21:16 -07:00
|
|
|
path: ./packages/**/dist
|
2024-05-24 03:32:50 -07:00
|
|
|
key: ${{ github.sha }}-base:build
|
2023-03-02 07:50:21 -08:00
|
|
|
|
|
|
|
unit-test:
|
|
|
|
name: Unit tests
|
2023-09-13 06:24:02 -07:00
|
|
|
uses: ./.github/workflows/units-tests-reusable.yml
|
2024-06-13 04:10:51 -07:00
|
|
|
needs: install-and-build
|
2023-09-13 06:24:02 -07:00
|
|
|
with:
|
2023-10-13 01:44:26 -07:00
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
2024-05-24 03:32:50 -07:00
|
|
|
cacheKey: ${{ github.sha }}-base:build
|
2024-11-04 06:08:04 -08:00
|
|
|
collectCoverage: true
|
|
|
|
secrets:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
2023-03-10 07:53:05 -08:00
|
|
|
|
2023-03-02 07:50:21 -08:00
|
|
|
lint:
|
2024-06-13 04:10:51 -07:00
|
|
|
name: Lint
|
|
|
|
uses: ./.github/workflows/linting-reusable.yml
|
|
|
|
needs: install-and-build
|
|
|
|
with:
|
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
|
|
|
cacheKey: ${{ github.sha }}-base:build
|