build.yml 1.83 KB
Newer Older
Jeremy Tuloup's avatar
Jeremy Tuloup committed
1
2
3
4
name: Build

on:
  push:
5
    branches: [main]
Jeremy Tuloup's avatar
Jeremy Tuloup committed
6
7
8
  pull_request:
    branches: '*'

9
10
11
env:
  CACHE_EPOCH: 0

Jeremy Tuloup's avatar
Jeremy Tuloup committed
12
13
14
15
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
16
17
18
19
20
21
      - name: Checkout
        uses: actions/checkout@v2
      - name: Install node
        uses: actions/setup-node@v2
        with:
          node-version: '14.x'
22
23
24
      - uses: actions/setup-python@v2
        with:
          python-version: '3.8'
25
26
      - name: Cache node modules
        uses: actions/cache@v2
27
        id: cache-node-modules
28
29
30
31
32
33
        with:
          path: 'node_modules/'
          key: |
            ${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
      - name: Cache yarn packages
        uses: actions/cache@v2
34
35
        id: cache-yarn-packages
        if: steps.cache-node-modules.outputs.cache-hit != 'true'
36
37
38
39
40
41
        with:
          path: '.yarn-packages'
          key: |
            ${{ env.CACHE_EPOCH }}-yarn-packages-${{ hashFiles('yarn.lock') }}
          restore-keys: |
            ${{ env.CACHE_EPOCH }}-yarn-packages-
42
43
44
45
46
47
48
49
50
51
52
      - uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: |
            ${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
          restore-keys: |
            ${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
      - name: Setup
        run: |
          pip install -U pip setuptools
          pip install -r requirements.txt
53
      - name: Install
Nicholas Bollweg's avatar
Nicholas Bollweg committed
54
        if: steps.cache-node-modules.outputs.cache-hit != 'true'
55
        run: |
Nicholas Bollweg's avatar
Nicholas Bollweg committed
56
          doit setup:js
57
58
      - name: Build
        run: |
59
          doit build
Nicholas Bollweg's avatar
Nicholas Bollweg committed
60
61
62
63
64
      - name: Upload (dist)
        uses: actions/upload-artifact@v2
        with:
          name: jupyterlite dist ${{ github.run_number }}
          path: ./dist
65
66
      - name: Lint
        run: |
67
          doit lint
68
69
      - name: Test
        run: |
70
          doit test