Skip to content

Commit

Permalink
Merge pull request chinedufn#138 from chinedufn/fix/ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
chinedufn authored Dec 18, 2019
2 parents eb631a2 + 4e0ba64 commit 452edfe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 73 deletions.
72 changes: 0 additions & 72 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,6 @@ version: 2

jobs:

test:
docker:
- image: rust:latest
steps:
- checkout

# Load cargo target from cache if possible.
# Multiple caches are used to increase the chance of a cache hit.
#
# Explanation: If you create a new branch, then there won't be a cache
# for that branch yet. (The branch is in the name of the cache key to
# prevent two branches overwriting each other's caches.)
#
# However, if you create a new branch, you could still use the latest
# cache of any other branch as a starting point. You probably won't be
# able to reuse everything, but – as long as cache invalidation works
# properly – you'll still be faster than if you don't have any cache
# at all.
- restore_cache:
keys:
- v9-cargo-cache-test-{{ arch }}-{{ .Branch }}
- v9-cargo-cache-test-{{ arch }}-

# Install nightly & wasm
- run:
name: Install Rust nightly
command: rustup update nightly && rustup default nightly
- run:
name: Add wasm32 target
command: rustup target add wasm32-unknown-unknown

# Install wasm tools
- run:
name: Install wasm-pack
command: >
curl -L https://github.com/rustwasm/wasm-pack/releases/download/v0.8.1/wasm-pack-v0.8.1-x86_64-unknown-linux-musl.tar.gz
| tar --strip-components=1 --wildcards -xzf - "*/wasm-pack"
&& chmod +x wasm-pack
&& mv wasm-pack $CARGO_HOME/bin/
# Install browsers
- run:
name: Install latest firefox
command: >
apt-get update
&& apt-get install -y libgtk-3-0 libdbus-glib-1-2
&& wget -q -O - "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US"
| tar xj
# Show versions
- run:
name: Show versions
command: rustc --version && cargo --version && wasm-pack --version && firefox/firefox --version

# Run tests
- run:
name: Run all tests
command: PATH=$(pwd)/firefox:$PATH ./test.sh

# Save cache
- save_cache:
key: v9-cargo-cache-test-{{ arch }}-{{ .Branch }}
paths:
- target
- /usr/local/cargo
- save_cache:
key: v9-cargo-cache-test-{{ arch }}-
paths:
- target
- /usr/local/cargo

docs-build:
docker:
- image: rust:latest
Expand Down Expand Up @@ -167,7 +96,6 @@ workflows:
version: 2
build:
jobs:
- test
- docs-build
- docs-deploy:
requires:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Percy CI

on: [push]

# TODO: Introduce caching https://github.com/actions/cache/blob/master/examples.md#rust---cargo
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions-rs/cargo@v1

- name: Latest Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
# Used when testing with `wasm-pack test`
target: wasm32-unknown-unknown

- name: Rust Version Info
run: rustc --version && cargo --version && echo $CARGO_HOME

- name: Install wasm-pack
run: >
curl -L https://github.com/rustwasm/wasm-pack/releases/download/v0.8.1/wasm-pack-v0.8.1-x86_64-unknown-linux-musl.tar.gz
| tar --strip-components=1 --wildcards -xzf - "*/wasm-pack"
&& chmod +x wasm-pack
&& mv wasm-pack $HOME/.cargo/bin/
- name: Browser versions
run: wasm-pack --version && firefox --version

- name: Run all tests
run: ./test.sh
2 changes: 1 addition & 1 deletion crates/virtual-dom-rs/src/patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use apply_patches::patch;
/// Our old virtual dom's nodes are indexed depth first, as shown in this illustration
/// (0 being the root node, 1 being it's first child, 2 being it's first child's first child).
///
/// ```ignore
/// ```text
/// .─.
/// ( 0 )
/// `┬'
Expand Down

0 comments on commit 452edfe

Please sign in to comment.