pyodide/.circleci/config.yml

148 lines
4.3 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:
2018-07-18 13:26:18 +00:00
- image: circleci/python:3.7.0-stretch-browsers
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
- run:
name: dependencies
command: |
# We need at least g++-8, but stretch comes with g++-6
# Set up the Debian testing repo, and then install g++ from there...
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
sudo apt-get update
2018-08-28 12:10:55 +00:00
sudo apt-get install node-less cmake build-essential clang-format-6.0 flake8 uglifyjs python3-yaml chromium ccache
2018-06-01 13:07:15 +00:00
sudo apt-get install -t testing g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --set gcc /usr/bin/gcc-8
2018-08-28 12:10:55 +00:00
sudo ln -s /usr/bin/clang-format-6.0 /usr/bin/clang-format
2018-06-01 13:07:15 +00:00
2018-08-17 08:29:10 +00:00
sudo pip install virtualenv
2018-07-18 13:26:18 +00:00
2018-08-17 08:29:10 +00:00
virtualenv pyodide-env
source pyodide-env/bin/activate
2018-07-18 13:26:18 +00:00
2018-08-17 08:29:10 +00:00
pip install pytest pytest-xdist pytest-instafail selenium PyYAML
2018-06-01 13:07:15 +00:00
# Get recent version of Firefox and geckodriver
wget -O firefox.tar.bz2 https://download.mozilla.org/\?product\=firefox-nightly-latest-ssl\&os\=linux64\&lang\=en-US
tar jxf firefox.tar.bz2
2018-08-03 19:09:50 +00:00
wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
tar zxf geckodriver-v0.21.0-linux64.tar.gz -C firefox
2018-06-01 13:07:15 +00:00
2018-07-10 13:38:23 +00:00
# Get recent version of chromedriver
2018-08-06 17:14:31 +00:00
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
2018-07-09 19:09:49 +00:00
unzip chromedriver_linux64.zip
mv chromedriver firefox
2018-06-14 18:19:08 +00:00
- run:
name: lint
command: |
2018-08-17 08:29:10 +00:00
source pyodide-env/bin/activate
2018-06-14 18:19:08 +00:00
make lint
2018-06-01 13:07:15 +00:00
- restore_cache:
keys:
- v1-emsdk-{{ checksum "emsdk/Makefile" }}-v6-
2018-06-01 13:07:15 +00:00
- run:
name: build
no_output_timeout: 1200
command: |
2018-08-17 08:29:10 +00:00
source pyodide-env/bin/activate
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
- save_cache:
paths:
- ./emsdk/emsdk
2018-07-24 15:27:58 +00:00
- ~/.ccache
2018-08-06 17:57:27 +00:00
key: v1-emsdk-{{ checksum "emsdk/Makefile" }}-v6-{{ .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
- ./pyodide-env
- ./firefox
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: |
2018-08-17 08:29:10 +00:00
# This Debian is so old, it doesn't know about wasm as a mime type, which then
# causes Firefox to complain when loading it. Let's just add the new mime type.
sudo bash -c "echo 'application/wasm wasm' >> /etc/mime.types"
source pyodide-env/bin/activate
2018-06-01 13:07:15 +00:00
export PATH=$PWD/firefox:$PATH
2018-08-28 09:59:12 +00:00
pytest test -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: |
# This Debian is so old, it doesn't know about wasm as a mime type, which then
# causes Firefox to complain when loading it. Let's just add the new mime type.
sudo bash -c "echo 'application/wasm wasm' >> /etc/mime.types"
source pyodide-env/bin/activate
export PATH=$PWD/firefox:$PATH
2018-08-28 09:59:12 +00:00
pytest test -v -k chrome
2018-06-19 17:36:14 +00:00
deploy:
machine:
enabled: true
2018-08-17 08:29:10 +00:00
2018-06-19 17:36:14 +00:00
steps:
2018-08-24 14:31:28 +00:00
- checkout
- attach_workspace:
at: .
2018-06-19 17:36:14 +00:00
- run:
name: Deploy to Github Pages
command: |
2018-09-10 13:09:26 +00:00
.circleci/deploy.sh
2018-06-19 17:36:14 +00:00
workflows:
version: 2
build-and-deploy:
jobs:
- build
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
- deploy:
requires:
- test-chrome
- test-firefox
2018-06-19 17:36:14 +00:00
filters:
branches:
only: master