pyodide/.circleci/config.yml

177 lines
3.8 KiB
YAML

version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: iodide/pyodide-env:0.3.1
environment:
- EMSDK_NUM_CORES: 4
EMCC_CORES: 4
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: lint
command: |
make lint
- restore_cache:
keys:
- v1-emsdk-{{ checksum "emsdk/Makefile" }}-v14-
- run:
name: build
no_output_timeout: 1200
command: |
ccache -z
make
ccache -s
- run:
name: check-size
command: ls -lh build/
- save_cache:
paths:
- ./emsdk/emsdk
- ~/.ccache
key: v1-emsdk-{{ checksum "emsdk/Makefile" }}-v14-{{ .BuildNum }}
- persist_to_workspace:
root: .
paths:
- ./build
- ./cpython/build/3.7.4/host
- store_artifacts:
path: /home/circleci/repo/build/
test-firefox:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: test
command: |
pytest test packages pyodide_build -v -k firefox
test-chrome:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: test
command: |
pytest test packages pyodide_build -v -k chrome
test-python:
<<: *defaults
steps:
- checkout
- run:
name: deps
command: |
sudo pip install pytest-cov
- run:
name: test
command: |
pytest test pyodide_build -v -k 'not (chrome or firefox)' --cov=pyodide_build --cov=pyodide
benchmark:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: benchmark
command: |
python benchmark/benchmark.py cpython/build/3.7.4/host/bin/python3 build/benchmarks.json
- store_artifacts:
path: /home/circleci/repo/build/benchmarks.json
deploy-release:
docker:
- image: cibuilds/github:0.10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Deploy Github Releases
command: |
pushd build
tar cjf ../pyodide-build-${CIRCLE_TAG}.tar.bz2 *
popd
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" -delete "${CIRCLE_TAG}" ./pyodide-build-${CIRCLE_TAG}.tar.bz2
deploy-netlify:
docker:
- image: circleci/node:latest
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Install netlify-cli
command: |
sudo npm install netlify-cli -g
- run:
name: Deploy to netlify
command: |
cp src/_headers build
netlify deploy --prod --dir=build -m "Deployed from CircleCI"
workflows:
version: 2
build-and-deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- test-chrome:
requires:
- build
- test-firefox:
requires:
- build
filters:
tags:
only: /.*/
- test-python:
filters:
tags:
only: /.*/
- benchmark:
requires:
- build
- deploy-release:
requires:
- test-firefox
- test-python
filters:
branches:
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/
- deploy-netlify:
requires:
- test-firefox
- test-python
filters:
branches:
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/