Skip to content

Commit

Permalink
Modernize CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 23, 2024
1 parent d349d37 commit cbb0fa7
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
name: "CI"
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
node-version:
- 18.x
- 20.x
- 22.x
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Ensure line endings are consistent
run: git config --global core.autocrlf input
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-test-modules-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-engines
- name: Build project
run: yarn run build
- name: Run tests
run: export NODE_OPTIONS="--max_old_space_size=4096" && yarn run test-ci
- name: Run browser tests
run: yarn run test-browser
- name: Submit coverage results
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.node-version }}
Expand All @@ -45,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Consolidate test coverage from different jobs
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
Expand All @@ -54,18 +60,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18.x
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-lint-modules-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-engines
- name: Run linter
run: yarn run lint

Expand All @@ -76,18 +82,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18.x
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-docker-modules-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-engines
- name: Install Lerna Docker
run: sh -c "`curl -fsSl https://raw.githubusercontent.com/rubensworks/lerna-docker/master/install.sh`"
- name: Build Docker images
Expand All @@ -103,23 +109,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18.x
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-docs-modules-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-engines
- name: Build docs
run: yarn run doc
- name: Deploy TSDoc to GitHub Pages
if: startsWith(github.ref, 'refs/heads/master')
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: documentation
Expand All @@ -132,18 +138,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18.x
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-webclients-modules-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-engines
- name: Build web clients
run: ./web-clients/build-web-clients.sh
- name: Deploy web clients
Expand Down

0 comments on commit cbb0fa7

Please sign in to comment.