mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-12-25 00:29:14 -05:00
128 lines
4.1 KiB
YAML
128 lines
4.1 KiB
YAML
name: ci
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.config.os }} ${{ matrix.config.target }}
|
|
if: |
|
|
github.event_name == 'push' ||
|
|
!startsWith(github.event.pull_request.head.label, 'denoland:')
|
|
runs-on: ${{ matrix.config.os }}
|
|
timeout-minutes: 120
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- os: macOS-latest
|
|
target: x86_64-apple-darwin
|
|
- os: ubuntu-16.04
|
|
target: "x86_64-unknown-linux-gnu"
|
|
# - os: ubuntu-16.04
|
|
# target: aarch64-unknown-linux-gnu
|
|
- os: windows-2019
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
steps:
|
|
- name: Configure git
|
|
run: git config --global core.symlinks true
|
|
|
|
- name: Clone repository
|
|
uses: actions/checkout@v1
|
|
with:
|
|
fetch-depth: 10
|
|
submodules: "recursive"
|
|
|
|
- name: Install rust
|
|
uses: hecrj/setup-rust-action@v1
|
|
with:
|
|
rust-version: "1.41.0"
|
|
|
|
- name: Install rust tools
|
|
run: rustup component add clippy rustfmt
|
|
|
|
- name: Install python
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: "2.7.x"
|
|
architecture: x64
|
|
|
|
# TODO(ry) Reenable arm build
|
|
# https://github.com/denoland/rusty_v8/runs/456845868
|
|
# - name: Install cross compilation toolchain
|
|
# if: matrix.config.target == 'aarch64-unknown-linux-gnu'
|
|
# run: |
|
|
# rustup target add aarch64-unknown-linux-gnu
|
|
#
|
|
# sudo apt install -yq --no-install-suggests --no-install-recommends \
|
|
# binfmt-support g++-5-aarch64-linux-gnu g++-5-multilib \
|
|
# gcc-5-aarch64-linux-gnu libc6-arm64-cross qemu qemu-user \
|
|
# qemu-user-binfmt
|
|
#
|
|
# sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 \
|
|
# /lib/ld-linux-aarch64.so.1
|
|
#
|
|
# echo "::set-env name=CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER::/usr/bin/aarch64-linux-gnu-gcc-5"
|
|
# echo "::set-env name=QEMU_LD_PREFIX::/usr/aarch64-linux-gnu"
|
|
|
|
- name: Install and start sccache
|
|
shell: pwsh
|
|
working-directory: ${{ runner.temp }}
|
|
env:
|
|
AWS_ACCESS_KEY_ID: AKIA6QEJVNZDGHRMR2KF
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
SCCACHE_BUCKET: deno-sccache
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
run: |
|
|
$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"
|
|
|
|
- name: Test
|
|
run: cargo test -vv --all-targets --locked
|
|
--target ${{ matrix.config.target }}
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --all-targets --locked
|
|
--target ${{ matrix.config.target }} -- -D clippy::all
|
|
|
|
- name: Rustfmt
|
|
run: cargo fmt -- --check
|
|
|
|
# TODO: add clang-format and maybe cpplint.
|
|
|
|
# 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
|
|
|
|
- name: Publish
|
|
# Only publish on x64 linux when there's a git tag:
|
|
if: >
|
|
startsWith(github.ref, 'refs/tags/') &&
|
|
github.repository == 'denoland/rusty_v8' &&
|
|
startsWith(matrix.config.target , 'x86_64') &&
|
|
runner.os == 'Linux'
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
run: cargo publish -vv
|
|
|
|
- name: Stop sccache
|
|
if: always()
|
|
run: sccache --stop-server
|