2019-10-31 21:01:29 -04:00
|
|
|
name: ci
|
|
|
|
|
2019-11-02 18:57:18 -04:00
|
|
|
on: [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-02 18:57:18 -04:00
|
|
|
os: [macOS-latest, 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:
|
2019-11-02 18:57:18 -04:00
|
|
|
fetch-depth: 10
|
2019-11-29 21:58:29 -05:00
|
|
|
submodules: 'recursive'
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
- name: Install rust
|
|
|
|
uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2019-12-19 19:02:19 -05:00
|
|
|
rust-version: "1.40.0"
|
2019-10-31 21:01:29 -04:00
|
|
|
|
2019-11-29 21:58:29 -05:00
|
|
|
- name: Install python
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: "2.7.x"
|
|
|
|
architecture: x64
|
2019-11-01 17:28:09 -04:00
|
|
|
|
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')
|
|
|
|
run: |
|
2019-12-04 14:24:56 -05:00
|
|
|
cd ..
|
2019-10-31 21:01:29 -04:00
|
|
|
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: |
|
2019-12-04 14:24:56 -05:00
|
|
|
cd ..
|
2019-10-31 21:01:29 -04:00
|
|
|
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: |
|
2019-12-04 14:24:56 -05:00
|
|
|
cd ..
|
2019-10-31 21:01:29 -04:00
|
|
|
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
|
|
|
|
2019-12-04 01:45:50 -05:00
|
|
|
- name: Publish
|
2019-12-04 14:24:56 -05:00
|
|
|
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/rusty_v8' && startsWith(matrix.os, 'ubuntu')
|
2019-12-04 01:45:50 -05:00
|
|
|
env:
|
|
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
|
|
run: cargo publish -vv
|
|
|
|
|
2019-11-02 18:57:18 -04:00
|
|
|
- name: Stop sccache
|
|
|
|
run: sccache --stop-server
|
|
|
|
|
2019-11-01 00:54:54 -04:00
|
|
|
# TODO cpplint
|