|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + |
| 5 | + lint: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + steps: |
| 8 | + - uses: actions/checkout@v2 |
| 9 | + - uses: actions/cache@v2 |
| 10 | + with: |
| 11 | + path: '**/node_modules' |
| 12 | + key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }} |
| 13 | + - uses: actions/setup-node@v2 |
| 14 | + with: |
| 15 | + node-version: 14.x |
| 16 | + - run: yarn install |
| 17 | + - run: yarn run lint |
| 18 | + |
| 19 | + test: |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + os: [ubuntu-latest] |
| 24 | + node-version: |
| 25 | + - 12.x |
| 26 | + - 14.x |
| 27 | + - 16.x |
| 28 | + steps: |
| 29 | + - name: Use Node.js ${{ matrix.node-version }} |
| 30 | + uses: actions/setup-node@v2 |
| 31 | + with: |
| 32 | + node-version: ${{ matrix.node-version }} |
| 33 | + - name: Ensure line endings are consistent |
| 34 | + run: git config --global core.autocrlf input |
| 35 | + - name: Check out repository |
| 36 | + uses: actions/checkout@v2 |
| 37 | + - uses: actions/cache@v2 |
| 38 | + with: |
| 39 | + path: '**/node_modules' |
| 40 | + key: ${{ runner.os }}-test-modules-${{ hashFiles('**/yarn.lock') }} |
| 41 | + - name: Install dependencies |
| 42 | + run: yarn install |
| 43 | + - name: Run tests |
| 44 | + run: yarn run test-ci |
| 45 | + - name: Submit coverage results |
| 46 | + uses: coverallsapp/github-action@master |
| 47 | + with: |
| 48 | + github-token: ${{ secrets.github_token }} |
| 49 | + flag-name: run-${{ matrix.node-version }} |
| 50 | + parallel: true |
| 51 | + |
| 52 | + coveralls: |
| 53 | + needs: test |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Consolidate test coverage from different jobs |
| 57 | + uses: coverallsapp/github-action@master |
| 58 | + with: |
| 59 | + github-token: ${{ secrets.github_token }} |
| 60 | + parallel-finished: true |
| 61 | + |
| 62 | + docker: |
| 63 | + needs: |
| 64 | + - test |
| 65 | + - lint |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - name: Use Node.js |
| 69 | + uses: actions/setup-node@v2 |
| 70 | + with: |
| 71 | + node-version: '14.x' |
| 72 | + - name: Check out repository |
| 73 | + uses: actions/checkout@v2 |
| 74 | + - name: Load cache |
| 75 | + uses: actions/cache@v2 |
| 76 | + with: |
| 77 | + path: '**/node_modules' |
| 78 | + key: ${{ runner.os }}-docker-modules-v1-${{ hashFiles('**/yarn.lock') }} |
| 79 | + - name: Install dependencies |
| 80 | + run: yarn install --pure-lockfile |
| 81 | + - name: Install Lerna Docker |
| 82 | + run: sh -c "`curl -fsSl https://raw.githubusercontent.com/rubensworks/lerna-docker/master/install.sh`" |
| 83 | + - name: Build Docker images |
| 84 | + run: ~/.lerna-docker/bin/lerna-docker linkeddatafragments build |
| 85 | + - name: Deploy Docker images |
| 86 | + if: startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') |
| 87 | + run: ~/.lerna-docker/bin/lerna-docker linkeddatafragments push |
| 88 | + env: |
| 89 | + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} |
| 90 | + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
0 commit comments