pyodide/.circleci/config.yml

147 lines
3.1 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
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
2018-10-02 13:25:35 +00:00
- ./cpython/build/3.7.0/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 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 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: |
2018-10-02 01:13:32 +00:00
python benchmark/benchmark.py cpython/build/3.7.0/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
2018-06-19 17:36:14 +00:00
deploy:
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
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
2018-08-17 08:29:10 +00:00
- deploy:
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:
ignore: /.*/
2018-11-02 15:25:13 +00:00
tags:
2018-11-07 14:44:13 +00:00
only: /^\d+\.\d+\.\d+$/