pyodide/.circleci/config.yml

177 lines
3.8 KiB
YAML
Raw Normal View History

2018-06-01 13:07:15 +00:00
version: 2
2018-08-17 08:29:10 +00:00
defaults: &defaults
working_directory: ~/repo
docker:
- image: iodide/pyodide-env:0.3.1
environment:
- EMSDK_NUM_CORES: 4
EMCC_CORES: 4
2018-06-01 13:07:15 +00:00
2018-08-17 08:29:10 +00:00
jobs:
build:
<<: *defaults
2018-06-01 13:07:15 +00:00
steps:
- checkout
2018-06-14 18:19:08 +00:00
- run:
name: lint
command: |
make lint
2018-06-01 13:07:15 +00:00
- restore_cache:
keys:
2019-04-04 11:57:47 +00:00
- v1-emsdk-{{ checksum "emsdk/Makefile" }}-v14-
2018-06-01 13:07:15 +00:00
- run:
name: build
no_output_timeout: 1200
command: |
2018-08-06 17:58:05 +00:00
ccache -z
2018-06-01 13:07:15 +00:00
make
2018-07-24 19:40:25 +00:00
ccache -s
2018-06-01 13:07:15 +00:00
2018-09-27 09:38:26 +00:00
- run:
name: check-size
command: ls -lh build/
2018-06-01 13:07:15 +00:00
- save_cache:
paths:
- ./emsdk/emsdk
2018-07-24 15:27:58 +00:00
- ~/.ccache
2019-04-04 11:57:47 +00:00
key: v1-emsdk-{{ checksum "emsdk/Makefile" }}-v14-{{ .BuildNum }}
2018-06-01 13:07:15 +00:00
2018-08-17 08:29:10 +00:00
- persist_to_workspace:
root: .
paths:
2018-08-24 14:31:28 +00:00
- ./build
2020-03-25 11:31:12 +00:00
- ./cpython/build/3.7.4/host
2018-08-17 08:29:10 +00:00
- store_artifacts:
path: /home/circleci/repo/build/
2018-08-17 08:29:10 +00:00
test-firefox:
<<: *defaults
steps:
2018-08-24 14:31:28 +00:00
- checkout
2018-08-17 08:29:10 +00:00
- attach_workspace:
at: .
2018-06-01 13:07:15 +00:00
- run:
name: test
command: |
pytest test packages pyodide_build -v -k firefox
2018-08-17 08:29:10 +00:00
test-chrome:
<<: *defaults
steps:
2018-08-24 14:31:28 +00:00
- checkout
2018-08-17 08:29:10 +00:00
- attach_workspace:
2018-08-24 14:31:28 +00:00
at: .
2018-08-17 08:29:10 +00:00
- run:
name: test
command: |
pytest test packages pyodide_build -v -k chrome
2018-06-19 17:36:14 +00:00
2018-10-15 15:04:54 +00:00
test-python:
<<: *defaults
steps:
- checkout
2018-10-16 13:31:00 +00:00
- run:
name: deps
command: |
sudo pip install pytest-cov
2018-10-15 15:04:54 +00:00
- run:
name: test
command: |
pytest test pyodide_build -v -k 'not (chrome or firefox)' --cov=pyodide_build --cov=pyodide
2018-10-15 15:04:54 +00:00
benchmark:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: benchmark
command: |
2020-03-25 11:31:12 +00:00
python benchmark/benchmark.py cpython/build/3.7.4/host/bin/python3 build/benchmarks.json
2018-10-02 13:25:35 +00:00
- store_artifacts:
2018-10-04 12:05:22 +00:00
path: /home/circleci/repo/build/benchmarks.json
2019-05-31 18:39:52 +00:00
deploy-release:
2018-11-02 15:25:13 +00:00
docker:
- image: cibuilds/github:0.10
2018-06-19 17:36:14 +00:00
steps:
2018-08-24 14:31:28 +00:00
- checkout
- attach_workspace:
2018-11-02 15:30:36 +00:00
at: .
2018-06-19 17:36:14 +00:00
- run:
2018-11-02 15:25:13 +00:00
name: Deploy Github Releases
2018-06-19 17:36:14 +00:00
command: |
2018-11-07 14:44:13 +00:00
pushd build
tar cjf ../pyodide-build-${CIRCLE_TAG}.tar.bz2 *
popd
2018-11-07 17:17:03 +00:00
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" -delete "${CIRCLE_TAG}" ./pyodide-build-${CIRCLE_TAG}.tar.bz2
2018-06-19 17:36:14 +00:00
2019-05-31 18:39:52 +00:00
deploy-netlify:
docker:
- image: circleci/node:latest
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Install netlify-cli
command: |
2019-05-31 19:50:35 +00:00
sudo npm install netlify-cli -g
2019-05-31 18:39:52 +00:00
- run:
name: Deploy to netlify
command: |
cp src/_headers build
netlify deploy --prod --dir=build -m "Deployed from CircleCI"
2018-06-19 17:36:14 +00:00
workflows:
version: 2
build-and-deploy:
jobs:
2018-11-06 14:59:54 +00:00
- build:
filters:
tags:
only: /.*/
2018-08-17 08:29:10 +00:00
- test-chrome:
2018-06-19 17:36:14 +00:00
requires:
- build
2018-08-17 08:29:10 +00:00
- test-firefox:
requires:
- build
2018-11-06 15:53:48 +00:00
filters:
tags:
only: /.*/
2018-11-06 14:59:54 +00:00
- test-python:
filters:
tags:
only: /.*/
- benchmark:
requires:
- build
2019-05-31 18:39:52 +00:00
- deploy-release:
requires:
- test-firefox
- test-python
filters:
branches:
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/
- deploy-netlify:
2018-08-17 08:29:10 +00:00
requires:
- test-firefox
2018-10-15 15:04:54 +00:00
- test-python
2018-06-19 17:36:14 +00:00
filters:
2018-11-06 14:20:01 +00:00
branches:
2019-05-31 19:50:59 +00:00
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/