-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (54 loc) · 1.68 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Main CI
on: [push, pull_request]
jobs:
build:
env:
CI: true
strategy:
matrix:
node-version: [16.x]
# Windows disabled for now, work it out later
platform: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Set git opts
run: |
git config --global core.autocrlf input
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: ".yarn/cache"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install project
run: |
yarn install --immutable
- name: Format ReScript
run: |
yarn workspaces foreach run rescript format -all
- name: Build all projects
run: |
yarn build
# Since we don't want to have generated code formatted in the router we regenerate
# the router code after formatting.
- name: Sync router code generation
run: |
yarn workspaces foreach --topological-dev run router:generate
- name: git status
id: git_status
shell: bash
run: |
echo "::set-output name=status::$( git status --porcelain )"
- name: Exit if routes have not been properly regenerated and commited, or if formatting is incorrect
shell: bash
run: |
git diff && exit 1
if: steps.git_status.outputs.status
- name: Run tests
if: runner.os != 'Windows'
run: |
yarn test