Skip to content

Commit

Permalink
ci: streamline CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 committed Sep 23, 2022
1 parent 2d5a691 commit 0ddb353
Showing 1 changed file with 49 additions and 17 deletions.
66 changes: 49 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,40 @@ executors:
## COMMANDS ##

commands:
npm_install:
parameters:
<<: *common_parameters
steps:
- when:
condition:
equal: [ alpine, << parameters.os >> ]
steps:
- run: apk update
- run: apk add --no-cache nodejs npm

- when:
condition:
equal: [ debian, << parameters.os >> ]
steps:
- run: apt-get update
- run: apt-get install --no-install-recommends -y ca-certificates nodejs npm

- when:
condition:
equal: [ linux, << parameters.os >> ]
steps:
- run: sudo apt-get update
- run: sudo apt-get install --no-install-recommends -y ca-certificates nodejs npm

- when:
condition:
equal: [ "win/default", << parameters.os >> ]
steps:
- run: git config --global core.autocrlf false
- run: git config --global core.eol lf

- run: npm install

prepare:
parameters:
<<: *common_parameters
Expand Down Expand Up @@ -74,8 +108,6 @@ commands:
steps:
- run: choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'
- run: choco install ninja
- run: git config --global core.autocrlf false
- run: git config --global core.eol lf

- run: git clone https://github.com/emscripten-core/emsdk.git

Expand All @@ -95,11 +127,7 @@ commands:
- run: cd emsdk && ./emsdk install latest
- run: cd emsdk && ./emsdk activate latest

- run: npm install

lint:
parameters:
<<: *common_parameters
steps:
- run: npm run lint

Expand Down Expand Up @@ -160,17 +188,20 @@ jobs:
executor: { name: << parameters.os >> }
steps:
- checkout
- prepare:
- npm_install:
os: << parameters.os >>
- lint:
- prepare:
os: << parameters.os >>
- lint

build:
parameters:
<<: *common_parameters
executor: { name: << parameters.os >> }
steps:
- checkout
- npm_install:
os: << parameters.os >>
- prepare:
os: << parameters.os >>
- build:
Expand All @@ -184,26 +215,27 @@ jobs:
executor: { name: << parameters.os >> }
steps:
- checkout
- prepare:
- npm_install:
os: << parameters.os >>
- test

## WORKFLOWS ##

matrix: &matrix
matrix:
parameters:
os: [ debian, linux, macos, "win/default" ]

workflows:
postject:
jobs:
- lint:
matrix:
parameters:
os: [ linux, macos, "win/default" ]
os: [ linux, macos ]
- build:
matrix:
parameters:
os: [ debian, linux, macos, "win/default" ]
<<: *matrix
- test:
matrix:
parameters:
os: [ alpine, debian, linux, macos, "win/default" ]
requires: [ build-linux ]
<<: *matrix
requires: [ build-<< matrix.os >> ]

0 comments on commit 0ddb353

Please sign in to comment.