2018-06-01 13:07:15 +00:00
|
|
|
version: 2
|
|
|
|
|
2018-08-17 08:29:10 +00:00
|
|
|
defaults: &defaults
|
|
|
|
working_directory: ~/repo
|
|
|
|
docker:
|
2021-01-10 13:14:50 +00:00
|
|
|
- image: iodide/pyodide-env:11
|
2019-12-31 17:09:39 +00:00
|
|
|
environment:
|
|
|
|
- EMSDK_NUM_CORES: 4
|
|
|
|
EMCC_CORES: 4
|
2020-12-26 07:01:03 +00:00
|
|
|
PYODIDE_BASE_URL: https://cdn.jsdelivr.net/pyodide/dev/full/
|
2018-06-01 13:07:15 +00:00
|
|
|
|
2018-08-17 08:29:10 +00:00
|
|
|
jobs:
|
2020-06-28 18:24:40 +00:00
|
|
|
lint:
|
2018-08-17 08:29:10 +00:00
|
|
|
<<: *defaults
|
2018-06-01 13:07:15 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
2018-06-14 18:19:08 +00:00
|
|
|
- run:
|
|
|
|
name: lint
|
2020-12-17 09:54:23 +00:00
|
|
|
command: make lint
|
2020-12-11 15:47:47 +00:00
|
|
|
|
2020-12-31 12:18:13 +00:00
|
|
|
build-docs:
|
|
|
|
working_directory: ~/repo
|
|
|
|
|
|
|
|
docker:
|
2021-02-06 20:17:57 +00:00
|
|
|
- image: cimg/python:3.8.2-node
|
2020-12-31 12:18:13 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Install prerequisites
|
2021-02-06 20:17:57 +00:00
|
|
|
command: |
|
|
|
|
pip install -r docs/requirements-doc.txt
|
|
|
|
sudo npm install -g jsdoc
|
2020-12-31 12:18:13 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Build docs
|
|
|
|
command: python3 -m sphinx -M html docs docs/_build
|
|
|
|
|
|
|
|
- store_artifacts:
|
|
|
|
path: /root/repo/docs/_build/
|
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
build-core:
|
2020-06-28 18:24:40 +00:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-06-14 18:19:08 +00:00
|
|
|
|
2018-06-01 13:07:15 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-12-11 15:47:47 +00:00
|
|
|
- -{{ checksum "Makefile.envs" }}-v20201205-
|
2018-06-01 13:07:15 +00:00
|
|
|
|
|
|
|
- run:
|
2020-12-11 15:47:47 +00:00
|
|
|
name: build emsdk
|
2018-06-01 13:07:15 +00:00
|
|
|
no_output_timeout: 1200
|
|
|
|
command: |
|
2018-08-06 17:58:05 +00:00
|
|
|
ccache -z
|
2020-12-11 15:47:47 +00:00
|
|
|
make -C emsdk
|
|
|
|
ccache -s
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: build cpython
|
|
|
|
no_output_timeout: 1200
|
|
|
|
command: |
|
|
|
|
ccache -z
|
|
|
|
make -C cpython
|
|
|
|
ccache -s
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: build pyodide core
|
|
|
|
no_output_timeout: 1200
|
|
|
|
command: |
|
|
|
|
ccache -z
|
|
|
|
# The following packages are currently used in the main pyodide test suite
|
2021-01-21 21:27:35 +00:00
|
|
|
PYODIDE_PACKAGES="micropip,pyparsing,pytz,packaging,kiwisolver" 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:
|
2018-07-24 15:27:58 +00:00
|
|
|
- ~/.ccache
|
2020-12-11 15:47:47 +00:00
|
|
|
key: -{{ checksum "Makefile.envs" }}-v20201205-{{ .BuildNum }}
|
2018-06-01 13:07:15 +00:00
|
|
|
|
2021-01-05 08:47:28 +00:00
|
|
|
- run:
|
|
|
|
name: Clean up workspace
|
|
|
|
command: |
|
|
|
|
rm -rf cpython/{build,downloads}
|
|
|
|
rm -rf emsdk/emsdk/binaryen
|
|
|
|
|
2018-08-17 08:29:10 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
2020-12-11 15:47:47 +00:00
|
|
|
- .
|
2018-08-17 08:29:10 +00:00
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
build-packages:
|
2020-05-08 23:46:59 +00:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
|
2020-05-08 23:46:59 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-12-11 15:47:47 +00:00
|
|
|
- -{{ checksum "Makefile.envs" }}-v20201205-
|
2020-05-08 23:46:59 +00:00
|
|
|
|
|
|
|
- run:
|
2020-12-11 15:47:47 +00:00
|
|
|
name: build packages
|
2020-05-08 23:46:59 +00:00
|
|
|
no_output_timeout: 1200
|
|
|
|
command: |
|
|
|
|
ccache -z
|
2020-12-11 15:47:47 +00:00
|
|
|
make
|
2020-05-08 23:46:59 +00:00
|
|
|
ccache -s
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: check-size
|
|
|
|
command: ls -lh build/
|
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.ccache
|
2020-12-12 11:31:21 +00:00
|
|
|
key: -{{ checksum "Makefile.envs" }}-v20201205-{{ .BuildNum }}
|
2020-12-11 15:47:47 +00:00
|
|
|
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- ./packages/.artifacts
|
|
|
|
- ./build
|
|
|
|
|
|
|
|
- store_artifacts:
|
2020-12-25 08:46:57 +00:00
|
|
|
path: /root/repo/build/
|
2020-12-11 15:47:47 +00:00
|
|
|
|
|
|
|
test-core-firefox:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2020-05-08 23:46:59 +00:00
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2020-12-14 17:05:15 +00:00
|
|
|
tools/pytest_wrapper.py src packages/micropip/ -v -k firefox -n 3
|
2020-05-08 23:46:59 +00:00
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
test-core-chrome:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2020-12-14 17:05:15 +00:00
|
|
|
tools/pytest_wrapper.py src packages/micropip/ -v -k chrome -n 3
|
2020-05-08 23:46:59 +00:00
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
test-packages-firefox:
|
2018-08-17 08:29:10 +00:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-06-01 13:07:15 +00:00
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2020-12-14 17:05:15 +00:00
|
|
|
tools/pytest_wrapper.py packages/test* packages/*/test* -v -k firefox -n 2
|
2018-08-17 08:29:10 +00:00
|
|
|
|
2020-12-11 15:47:47 +00:00
|
|
|
test-packages-chrome:
|
2018-08-17 08:29:10 +00:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
2018-08-24 14:31:28 +00:00
|
|
|
at: .
|
2018-08-17 08:29:10 +00:00
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2020-12-14 17:05:15 +00:00
|
|
|
tools/pytest_wrapper.py packages/test* packages/*/test* -v -k chrome -n 2
|
2018-06-19 17:36:14 +00:00
|
|
|
|
2020-12-21 03:20:11 +00:00
|
|
|
test-emsdk:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: test
|
2021-01-03 11:25:14 +00:00
|
|
|
command: make -C emsdk test
|
2020-12-21 03:20:11 +00:00
|
|
|
|
2018-10-15 15:04:54 +00:00
|
|
|
test-python:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2020-12-11 15:47:47 +00:00
|
|
|
pytest src pyodide_build packages/micropip/ -v -k 'not (chrome or firefox)' --cov=pyodide_build --cov=pyodide
|
2018-10-15 15:04:54 +00:00
|
|
|
|
2018-10-01 20:57:08 +00:00
|
|
|
benchmark:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: benchmark
|
|
|
|
command: |
|
2020-12-07 23:19:16 +00:00
|
|
|
python benchmark/benchmark.py /usr/local/bin/python3 build/benchmarks.json
|
2018-10-02 13:25:35 +00:00
|
|
|
- store_artifacts:
|
2020-12-25 08:46:57 +00:00
|
|
|
path: /root/repo/build/benchmarks.json
|
2018-10-01 20:57:08 +00:00
|
|
|
|
2019-05-31 18:39:52 +00:00
|
|
|
deploy-release:
|
2018-11-02 15:25:13 +00:00
|
|
|
docker:
|
2020-11-01 10:24:24 +00:00
|
|
|
- image: cibuilds/github:0.13
|
2018-11-02 15:25:13 +00:00
|
|
|
|
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: .
|
2020-05-19 16:15:21 +00:00
|
|
|
- run:
|
|
|
|
name: Install requirements
|
|
|
|
command: |
|
|
|
|
apk add --no-cache --update python3
|
|
|
|
python3 -m pip install awscli
|
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: |
|
2020-08-18 08:59:56 +00:00
|
|
|
cp -r build /tmp/pyodide
|
|
|
|
cd /tmp/
|
|
|
|
tar cjf pyodide-build-${CIRCLE_TAG}.tar.bz2 pyodide/
|
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
|
|
|
|
2020-05-19 16:15:21 +00:00
|
|
|
- run:
|
|
|
|
name: Deploy to pyodide-cdn2.iodide.io
|
|
|
|
command: |
|
2020-10-20 19:56:59 +00:00
|
|
|
find build/ -type f -exec sh -c "echo \"Compressing {}\"; gzip {}; mv {}.gz {};" \;
|
|
|
|
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/v${CIRCLE_TAG}/full/" --exclude '*.data' --cache-control 'max-age=30758400, immutable, public' --content-encoding 'gzip' # 1 year cache
|
|
|
|
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/v${CIRCLE_TAG}/full/" --exclude '*' --include '*.data' --cache-control 'max-age=30758400, immutable, public' --content-type 'application/wasm' --content-encoding 'gzip' # 1 year
|
2020-05-19 16:15:21 +00:00
|
|
|
# update 301 redirect for the /latest/* route.
|
|
|
|
aws s3api put-bucket-website --cli-input-json file://.circleci/s3-website-config.json
|
|
|
|
|
|
|
|
deploy-s3:
|
2019-05-31 18:39:52 +00:00
|
|
|
docker:
|
2020-05-19 16:15:21 +00:00
|
|
|
- image: circleci/python:3.7.7
|
2019-05-31 18:39:52 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
2020-05-19 16:15:21 +00:00
|
|
|
name: Install requirements
|
2019-05-31 18:39:52 +00:00
|
|
|
command: |
|
2020-10-20 19:56:59 +00:00
|
|
|
sudo apt-get update
|
2020-05-19 16:15:21 +00:00
|
|
|
sudo apt-get install -y groff
|
|
|
|
python3 -m pip install awscli
|
2019-05-31 18:39:52 +00:00
|
|
|
- run:
|
2020-05-19 16:15:21 +00:00
|
|
|
name: Deploy to pyodide-cdn2.iodide.io
|
2019-05-31 18:39:52 +00:00
|
|
|
command: |
|
2020-10-20 19:56:59 +00:00
|
|
|
find build/ -type f -exec sh -c "echo \"Compressing {}\"; gzip {}; mv {}.gz {};" \;
|
2020-05-23 14:02:10 +00:00
|
|
|
aws s3 rm --recursive "s3://pyodide-cdn2.iodide.io/dev/full/"
|
2020-10-20 19:56:59 +00:00
|
|
|
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/dev/full/" --exclude '*.data' --cache-control 'max-age=3600, public' --content-encoding 'gzip' # 1 hour cache
|
|
|
|
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/dev/full/" --exclude '*' --include '*.data' --cache-control 'max-age=3600, public' --content-type 'application/wasm' --content-encoding 'gzip' # 1 hour cache
|
2019-05-31 18:39:52 +00:00
|
|
|
|
2018-06-19 17:36:14 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-and-deploy:
|
|
|
|
jobs:
|
2020-06-28 18:24:40 +00:00
|
|
|
- lint
|
2020-12-31 12:18:13 +00:00
|
|
|
- build-docs
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-core:
|
2018-11-06 14:59:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-packages:
|
2020-06-28 18:24:40 +00:00
|
|
|
requires:
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-core
|
2020-12-25 08:45:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-12-11 15:47:47 +00:00
|
|
|
- test-core-chrome:
|
2018-06-19 17:36:14 +00:00
|
|
|
requires:
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-core
|
2020-12-25 08:45:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-12-11 15:47:47 +00:00
|
|
|
- test-core-firefox:
|
2018-08-17 08:29:10 +00:00
|
|
|
requires:
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-core
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test-packages-chrome:
|
|
|
|
requires:
|
|
|
|
- build-packages
|
2020-12-25 08:45:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-12-11 15:47:47 +00:00
|
|
|
- test-packages-firefox:
|
|
|
|
requires:
|
|
|
|
- build-packages
|
2018-11-06 15:53:48 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-12-21 03:20:11 +00:00
|
|
|
- test-emsdk:
|
|
|
|
requires:
|
|
|
|
- build-core
|
2020-12-25 08:45:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2018-11-06 14:59:54 +00:00
|
|
|
- test-python:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2018-10-01 20:57:08 +00:00
|
|
|
- benchmark:
|
|
|
|
requires:
|
2020-12-11 15:47:47 +00:00
|
|
|
- build-packages
|
2019-05-31 18:39:52 +00:00
|
|
|
- deploy-release:
|
|
|
|
requires:
|
2020-12-31 10:09:58 +00:00
|
|
|
- lint
|
|
|
|
- test-python
|
2020-12-11 15:47:47 +00:00
|
|
|
- test-core-firefox
|
|
|
|
- test-packages-firefox
|
2020-12-25 08:45:54 +00:00
|
|
|
- test-core-chrome
|
|
|
|
- test-emsdk
|
2020-12-31 12:18:13 +00:00
|
|
|
- build-docs
|
2019-05-31 18:39:52 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
|
|
|
only: /^\d+\.\d+\.\d+$/
|
2020-05-19 16:15:21 +00:00
|
|
|
- deploy-s3:
|
2018-08-17 08:29:10 +00:00
|
|
|
requires:
|
2020-12-31 10:09:58 +00:00
|
|
|
- lint
|
|
|
|
- test-python
|
2020-12-11 15:47:47 +00:00
|
|
|
- test-core-firefox
|
|
|
|
- test-packages-firefox
|
2020-12-25 08:45:54 +00:00
|
|
|
- test-core-chrome
|
|
|
|
- test-emsdk
|
2020-12-31 12:18:13 +00:00
|
|
|
- build-docs
|
2018-06-19 17:36:14 +00:00
|
|
|
filters:
|
2018-11-06 14:20:01 +00:00
|
|
|
branches:
|
2020-05-19 16:15:21 +00:00
|
|
|
only: master
|