2019-10-31 21:01:29 -04:00
|
|
|
name: ci
|
|
|
|
|
2019-11-01 00:10:00 -04:00
|
|
|
on: [push] # TODO(ry) [push, pull_request]
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.kind }} ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-11-01 14:28:09 -07:00
|
|
|
os: [macOS-10.14, ubuntu-16.04, windows-2019]
|
2019-10-31 21:01:29 -04:00
|
|
|
steps:
|
|
|
|
- name: Configure git
|
|
|
|
run: git config --global core.symlinks true
|
|
|
|
|
|
|
|
- name: Clone repository
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- name: Install rust
|
|
|
|
uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
|
|
|
rust-version: "1.38.0"
|
|
|
|
|
2019-11-01 14:28:09 -07:00
|
|
|
- name: Remove unused versions of Python
|
|
|
|
# Depot_tools bootstraps its own copy of virtualenv. This fails on
|
|
|
|
# windows when multiple versions of python are in present in PATH,
|
|
|
|
# so we remove all but the first one.
|
|
|
|
# 🤯 Removing items from PATH does not seem possible on Github Actions,
|
|
|
|
# not even by using `echo ::set-env name=PATH`, so we have to rename
|
|
|
|
# or delete the actual Python directories.
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |-
|
|
|
|
$env:PATH -split ";" |
|
|
|
|
Where-Object { Test-Path "$_\python.exe" } |
|
|
|
|
Select-Object -Skip 1 |
|
|
|
|
ForEach-Object { Move-Item "$_" "$_.disabled" }
|
|
|
|
|
2019-10-31 21:01:29 -04:00
|
|
|
- name: Environment (common)
|
2019-11-02 14:51:37 -04:00
|
|
|
run: echo ::set-env name=RUSTC_WRAPPER::sccache
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
- name: Environment (linux)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
# In order to test the installer scripts in std we need a deno
|
|
|
|
# executable in the path. See
|
|
|
|
# https://github.com/denoland/deno/blob/27cd2c97f18c0392bc04c66b786717b2bc677315/std/installer/mod.ts#L185-L193
|
|
|
|
# TODO(ry) This path modification should rather be done in "cargo test".
|
|
|
|
run: |
|
|
|
|
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-unknown-linux-musl.tar.gz
|
|
|
|
tar -xzvf sccache-0.2.12-x86_64-unknown-linux-musl.tar.gz
|
|
|
|
echo ::add-path::`pwd`/sccache-0.2.12-x86_64-unknown-linux-musl/
|
|
|
|
|
|
|
|
- name: Environment (mac)
|
|
|
|
if: startsWith(matrix.os, 'macOS')
|
|
|
|
run: |
|
|
|
|
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-apple-darwin.tar.gz
|
|
|
|
tar -xzvf sccache-0.2.12-x86_64-apple-darwin.tar.gz
|
|
|
|
echo ::add-path::`pwd`/sccache-0.2.12-x86_64-apple-darwin/
|
|
|
|
|
|
|
|
- name: Environment (windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
|
|
|
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-pc-windows-msvc.tar.gz
|
|
|
|
tar -zxvf sccache-0.2.12-x86_64-pc-windows-msvc.tar.gz
|
|
|
|
echo ::add-path::$(pwd)\sccache-0.2.12-x86_64-pc-windows-msvc\
|
|
|
|
|
|
|
|
- name: Start sccache
|
|
|
|
env:
|
2019-11-01 00:10:00 -04:00
|
|
|
AWS_ACCESS_KEY_ID: AKIA6QEJVNZDGHRMR2KF
|
2019-10-31 21:01:29 -04:00
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
SCCACHE_BUCKET: deno-sccache
|
|
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
|
|
run: sccache --start-server
|
|
|
|
|
|
|
|
- name: Build
|
2019-11-01 00:10:00 -04:00
|
|
|
run: |
|
|
|
|
git --version
|
|
|
|
cargo build -vv --release --locked --all-targets
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: cargo test -vv --release --locked --all-targets
|
|
|
|
|
|
|
|
- name: Clippy
|
2019-11-01 00:10:00 -04:00
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
|
|
|
cargo clippy --all-targets --release --locked -- -D clippy::all
|
2019-11-01 00:54:54 -04:00
|
|
|
|
|
|
|
# TODO cpplint
|