2019-10-31 21:01:29 -04:00
|
|
|
name: ci
|
|
|
|
|
2020-01-06 18:07:46 -05:00
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.kind }} ${{ matrix.os }}
|
2020-01-06 18:07:46 -05:00
|
|
|
if: |
|
|
|
|
github.event_name == 'push' ||
|
|
|
|
!startsWith(github.event.pull_request.head.label, 'denoland:')
|
2019-10-31 21:01:29 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-01-06 18:07:46 -05:00
|
|
|
timeout-minutes: 120
|
2019-10-31 21:01:29 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-01-06 18:07:46 -05: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
|
2020-01-06 18:07:46 -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
|
|
|
|
2020-01-06 18:07:46 -05:00
|
|
|
- name: Install and start sccache
|
|
|
|
shell: pwsh
|
|
|
|
working-directory: ${{ runner.temp }}
|
2019-10-31 21:01:29 -04:00
|
|
|
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
|
2019-11-01 00:10:00 -04:00
|
|
|
run: |
|
2020-01-06 18:07:46 -05:00
|
|
|
$version = "0.2.12"
|
|
|
|
$platform =
|
|
|
|
@{ "macOS" = "x86_64-apple-darwin"
|
|
|
|
"Linux" = "x86_64-unknown-linux-musl"
|
|
|
|
"Windows" = "x86_64-pc-windows-msvc"
|
|
|
|
}.${{ runner.os }}
|
|
|
|
$basename = "sccache-$version-$platform"
|
|
|
|
$url = "https://github.com/mozilla/sccache/releases/download/" +
|
|
|
|
"$version/$basename.tar.gz"
|
|
|
|
|
|
|
|
curl -LO $url
|
|
|
|
tar -xzvf "$basename.tar.gz"
|
|
|
|
. $basename/sccache --start-server
|
|
|
|
|
|
|
|
echo "::add-path::$(pwd)/$basename"
|
|
|
|
echo "::set-env name=RUSTC_WRAPPER::sccache"
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
- name: Test
|
2020-01-06 18:07:46 -05:00
|
|
|
run: cargo test -vv --locked --all-targets
|
2019-10-31 21:01:29 -04:00
|
|
|
|
|
|
|
- name: Clippy
|
2019-11-01 00:10:00 -04:00
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
2020-01-06 18:07:46 -05:00
|
|
|
cargo clippy --all-targets --locked -- -D clippy::all
|
2019-11-01 00:54:54 -04:00
|
|
|
|
2019-12-22 10:43:59 -05:00
|
|
|
- name: Rustfmt
|
|
|
|
run: |
|
|
|
|
rustup component add rustfmt
|
|
|
|
cargo fmt -- --check
|
|
|
|
|
2020-01-06 18:07:46 -05:00
|
|
|
# TODO: add clang-format and maybe cpplint.
|
|
|
|
|
2020-01-15 15:14:39 -05:00
|
|
|
# TODO(ry) It would be ideal to check that "cargo package" also runs and
|
|
|
|
# that the resulting package is less than 10 MB. However it seems to
|
|
|
|
# result in a complete V8 rebuild. For now just be careful not to manually
|
|
|
|
# check that "cargo package" is working when updating the build.
|
|
|
|
# - name: Package
|
|
|
|
# run: cargo package -vv --locked
|
2020-01-06 18:07:46 -05:00
|
|
|
|
2019-12-04 01:45:50 -05:00
|
|
|
- name: Publish
|
2020-01-06 18:07:46 -05:00
|
|
|
if: >
|
|
|
|
startsWith(github.ref, 'refs/tags/') &&
|
|
|
|
github.repository == 'denoland/rusty_v8' &&
|
|
|
|
runner.os == 'Linux'
|
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
|
2020-01-06 18:07:46 -05:00
|
|
|
if: always()
|
2019-11-02 18:57:18 -04:00
|
|
|
run: sccache --stop-server
|