pyodide/.circleci/config.yml

284 lines
7.6 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:9
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:
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
command: |
make lint
black --check --exclude tools/file_packager.py .
mypy --ignore-missing-imports pyodide_build/ src/ packages/micropip/micropip/ packages/*/test*
build-core:
<<: *defaults
steps:
- checkout
2018-06-14 18:19:08 +00:00
2018-06-01 13:07:15 +00:00
- restore_cache:
keys:
- -{{ checksum "Makefile.envs" }}-v20201205-
2018-06-01 13:07:15 +00:00
- run:
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
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
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
key: -{{ checksum "Makefile.envs" }}-v20201205-{{ .BuildNum }}
2018-06-01 13:07:15 +00:00
2018-08-17 08:29:10 +00:00
- persist_to_workspace:
root: .
paths:
- .
2018-08-17 08:29:10 +00:00
build-packages:
2020-05-08 23:46:59 +00:00
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
2020-05-08 23:46:59 +00:00
- restore_cache:
keys:
- -{{ checksum "Makefile.envs" }}-v20201205-
2020-05-08 23:46:59 +00:00
- run:
name: build packages
2020-05-08 23:46:59 +00:00
no_output_timeout: 1200
command: |
ccache -z
# Mark CLAPACK as not built as it's currently incorrectly marked as built
# when running make with PYODIDE_PACKAGES
# TODO: this should be resolved with #713
make -C packages/CLAPACK clean
make
2020-05-08 23:46:59 +00:00
ccache -s
- run:
name: check-size
command: ls -lh build/
- save_cache:
paths:
- ~/.ccache
2020-12-12 11:31:21 +00:00
key: -{{ checksum "Makefile.envs" }}-v20201205-{{ .BuildNum }}
- persist_to_workspace:
root: .
paths:
- ./packages/.artifacts
- ./build
- store_artifacts:
path: /home/circleci/repo/build/
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
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
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
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
2018-10-15 15:04:54 +00:00
test-python:
<<: *defaults
steps:
- checkout
- run:
name: test
command: |
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
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:
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.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: .
- 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: |
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
- run:
name: Deploy to pyodide-cdn2.iodide.io
command: |
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
# 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:
- image: circleci/python:3.7.7
2019-05-31 18:39:52 +00:00
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Install requirements
2019-05-31 18:39:52 +00:00
command: |
sudo apt-get update
sudo apt-get install -y groff
python3 -m pip install awscli
2019-05-31 18:39:52 +00:00
- run:
name: Deploy to pyodide-cdn2.iodide.io
2019-05-31 18:39:52 +00:00
command: |
find build/ -type f -exec sh -c "echo \"Compressing {}\"; gzip {}; mv {}.gz {};" \;
aws s3 rm --recursive "s3://pyodide-cdn2.iodide.io/dev/full/"
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:
- lint
- build-core:
requires:
- lint
- test-python
2018-11-06 14:59:54 +00:00
filters:
tags:
only: /.*/
- build-packages:
requires:
- build-core
- test-core-chrome:
2018-06-19 17:36:14 +00:00
requires:
- build-core
- test-core-firefox:
2018-08-17 08:29:10 +00:00
requires:
- build-core
filters:
tags:
only: /.*/
- test-packages-chrome:
requires:
- build-packages
- test-packages-firefox:
requires:
- build-packages
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-packages
2019-05-31 18:39:52 +00:00
- deploy-release:
requires:
- test-core-firefox
- test-packages-firefox
2019-05-31 18:39:52 +00:00
filters:
branches:
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/
- deploy-s3:
2018-08-17 08:29:10 +00:00
requires:
- test-core-firefox
- test-packages-firefox
2018-06-19 17:36:14 +00:00
filters:
2018-11-06 14:20:01 +00:00
branches:
only: master