2019-10-29 17:07:15 -04:00
|
|
|
name: ci
|
2019-09-18 17:23:27 -04:00
|
|
|
|
2019-09-18 19:37:31 -04:00
|
|
|
on: [push, pull_request]
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2019-10-02 19:00:46 -04:00
|
|
|
name: ${{ matrix.kind }} ${{ matrix.os }}
|
2019-09-18 17:23:27 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-10-04 14:50:30 -04:00
|
|
|
timeout-minutes: 60
|
2019-09-18 17:23:27 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-10-31 22:36:22 -04:00
|
|
|
os: [macOS-latest, windows-2019, ubuntu-16.04]
|
2019-11-15 13:31:53 -05:00
|
|
|
kind: ['test', 'test_debug', 'bench', 'lint']
|
2019-10-02 19:00:46 -04:00
|
|
|
exclude:
|
2019-10-24 17:56:14 -04:00
|
|
|
- os: windows-2019
|
2019-10-02 19:00:46 -04:00
|
|
|
kind: 'bench'
|
2019-10-31 22:36:22 -04:00
|
|
|
- os: macOS-latest
|
2019-10-02 19:00:46 -04:00
|
|
|
kind: 'bench'
|
2019-10-14 17:35:43 -04:00
|
|
|
|
2019-10-24 17:56:14 -04:00
|
|
|
- os: windows-2019
|
2019-10-14 17:35:43 -04:00
|
|
|
kind: 'lint'
|
2019-10-31 22:36:22 -04:00
|
|
|
- os: macOS-latest
|
2019-10-05 03:17:18 -04:00
|
|
|
kind: 'lint'
|
2019-10-14 17:35:43 -04:00
|
|
|
|
2019-10-24 17:56:14 -04:00
|
|
|
- os: windows-2019
|
2019-10-14 17:35:43 -04:00
|
|
|
kind: 'test_debug'
|
2019-10-31 22:36:22 -04:00
|
|
|
- os: macOS-latest
|
2019-10-14 17:35:43 -04:00
|
|
|
kind: 'test_debug'
|
2019-09-18 17:23:27 -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
|
|
|
|
|
2019-10-25 15:29:17 -04:00
|
|
|
- name: Create source tarballs (release, linux)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
|
|
|
|
run: |
|
|
|
|
mkdir -p target/release
|
2019-11-05 17:06:16 -05:00
|
|
|
tar --exclude=".git*" --exclude=target --exclude=deno_typescript/typescript/tests --exclude=third_party/cpplint --exclude=third_party/node_modules --exclude=third_party/python_packages --exclude=third_party/prebuilt -czvf target/release/deno_src.tar.gz -C .. deno
|
2019-10-25 15:29:17 -04:00
|
|
|
|
2019-09-18 17:23:27 -04:00
|
|
|
- name: Install rust
|
|
|
|
uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2019-11-07 14:21:45 -05:00
|
|
|
rust-version: "1.39.0"
|
2019-09-18 17:23:27 -04:00
|
|
|
|
2019-10-05 03:17:18 -04:00
|
|
|
- name: Install clippy and rustfmt
|
|
|
|
if: matrix.kind == 'lint'
|
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
|
|
|
rustup component add rustfmt
|
|
|
|
|
2019-09-18 17:23:27 -04:00
|
|
|
- name: Install python
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: "2.7.16"
|
|
|
|
architecture: x64
|
|
|
|
|
|
|
|
- name: Environment (common)
|
|
|
|
run: |
|
|
|
|
echo ::set-env name=GH_ACTIONS::1
|
|
|
|
echo ::set-env name=RUSTC_WRAPPER::sccache
|
|
|
|
echo ::set-env name=DENO_BUILD_MODE::release
|
2019-11-14 08:56:47 -05:00
|
|
|
echo ::set-env name=RUST_BACKTRACE::full
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
- name: Environment (linux)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2019-10-21 11:58:45 -04:00
|
|
|
# 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".
|
2019-09-18 17:23:27 -04:00
|
|
|
run: |
|
2019-10-28 22:04:24 -04:00
|
|
|
echo ::add-path::`pwd`/third_party/prebuilt/linux64
|
2019-10-21 11:58:45 -04:00
|
|
|
echo ::add-path::`pwd`/target/release
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
- name: Environment (mac)
|
|
|
|
if: startsWith(matrix.os, 'macOS')
|
|
|
|
run: |
|
2019-10-28 22:04:24 -04:00
|
|
|
echo ::add-path::`pwd`/third_party/prebuilt/mac
|
2019-10-21 11:58:45 -04:00
|
|
|
echo ::add-path::`pwd`/target/release
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
- name: Environment (windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
2019-10-28 22:04:24 -04:00
|
|
|
echo ::add-path::$(pwd)\third_party\prebuilt\win
|
2019-10-24 15:13:46 -04:00
|
|
|
echo ::add-path::$(pwd)\target\release
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
- name: Log versions
|
|
|
|
run: |
|
|
|
|
node -v
|
|
|
|
python --version
|
|
|
|
rustc --version
|
|
|
|
cargo --version
|
|
|
|
|
|
|
|
- name: Run setup.py
|
|
|
|
run: python ./tools/setup.py
|
|
|
|
|
|
|
|
- name: Start sccache
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: AKIAIVRN52PLDBP55LBQ
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
SCCACHE_BUCKET: deno-sccache
|
|
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
|
|
run: sccache --start-server
|
|
|
|
|
2019-10-05 03:17:18 -04:00
|
|
|
- name: lint.py
|
|
|
|
if: matrix.kind == 'lint'
|
|
|
|
run: python ./tools/lint.py
|
|
|
|
|
|
|
|
- name: test_format.py
|
|
|
|
if: matrix.kind == 'lint'
|
|
|
|
run: python ./tools/test_format.py
|
|
|
|
|
|
|
|
- name: Clippy
|
|
|
|
if: matrix.kind == 'lint'
|
|
|
|
run: cargo clippy --all-targets --release --locked -- -D clippy::all
|
|
|
|
|
2019-09-18 17:23:27 -04:00
|
|
|
- name: Build
|
2019-11-15 13:31:53 -05:00
|
|
|
if: matrix.kind == 'test' || matrix.kind == 'bench'
|
2019-09-19 14:48:05 -04:00
|
|
|
run: cargo build --release --locked --all-targets
|
2019-09-18 17:23:27 -04:00
|
|
|
|
|
|
|
- name: Test
|
2019-10-02 19:00:46 -04:00
|
|
|
if: matrix.kind == 'test'
|
2019-09-19 14:48:05 -04:00
|
|
|
run: cargo test --release --locked --all-targets
|
2019-09-18 17:23:27 -04:00
|
|
|
|
2019-10-14 17:35:43 -04:00
|
|
|
- name: Test debug
|
|
|
|
if: matrix.kind == 'test_debug'
|
|
|
|
run: |
|
|
|
|
echo ::set-env name=DENO_BUILD_MODE::debug
|
|
|
|
cargo test --locked --all-targets
|
|
|
|
|
2019-10-02 19:00:46 -04:00
|
|
|
- name: Run Benchmarks
|
|
|
|
if: matrix.kind == 'bench'
|
|
|
|
run: python ./tools/benchmark.py target/release
|
|
|
|
|
|
|
|
- name: Post Benchmarks
|
2019-10-05 10:45:35 -04:00
|
|
|
if: matrix.kind == 'bench' && github.ref == 'refs/heads/master' && github.repository == 'denoland/deno'
|
2019-10-02 19:00:46 -04:00
|
|
|
env:
|
|
|
|
DENOBOT_PAT: ${{ secrets.DENOBOT_PAT }}
|
|
|
|
run: |
|
2019-10-06 11:18:15 -04:00
|
|
|
git clone --depth 1 -b gh-pages https://${DENOBOT_PAT}@github.com/denoland/deno.git gh-pages
|
|
|
|
python ./tools/build_benchmark_jsons.py
|
2019-10-02 19:00:46 -04:00
|
|
|
cd gh-pages
|
|
|
|
git config user.email "propelml@gmail.com"
|
|
|
|
git config user.name "denobot"
|
|
|
|
git add .
|
|
|
|
git commit --message "Update benchmarks"
|
2019-10-06 11:18:15 -04:00
|
|
|
git push origin gh-pages
|
2019-10-02 19:00:46 -04:00
|
|
|
|
|
|
|
- name: Worker info
|
|
|
|
if: matrix.kind == 'bench'
|
|
|
|
run: |
|
|
|
|
cat /proc/cpuinfo
|
|
|
|
cat /proc/meminfo
|
|
|
|
|
2019-10-03 13:20:59 -04:00
|
|
|
- name: Pre-release (linux)
|
2019-10-14 17:35:43 -04:00
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test'
|
2019-10-03 13:20:59 -04:00
|
|
|
run: gzip -c target/release/deno > target/release/deno_linux_x64.gz
|
|
|
|
|
|
|
|
- name: Pre-release (mac)
|
2019-10-14 17:35:43 -04:00
|
|
|
if: startsWith(matrix.os, 'macOS') && matrix.kind == 'test'
|
2019-10-03 13:20:59 -04:00
|
|
|
run: gzip -c target/release/deno > target/release/deno_osx_x64.gz
|
|
|
|
|
|
|
|
- name: Pre-release (windows)
|
2019-10-14 17:35:43 -04:00
|
|
|
if: startsWith(matrix.os, 'windows') && matrix.kind == 'test'
|
2019-10-24 15:13:46 -04:00
|
|
|
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno_win_x64.zip
|
2019-10-03 13:20:59 -04:00
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2019-10-05 10:45:35 -04:00
|
|
|
if: matrix.kind == 'test' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
|
2019-10-03 13:20:59 -04:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
target/release/deno_win_x64.zip
|
|
|
|
target/release/deno_linux_x64.gz
|
|
|
|
target/release/deno_osx_x64.gz
|
2019-10-25 15:29:17 -04:00
|
|
|
target/release/deno_src.tar.gz
|
2019-10-03 13:20:59 -04:00
|
|
|
draft: true
|
|
|
|
|
2019-09-18 17:23:27 -04:00
|
|
|
- name: Stop sccache
|
|
|
|
run: sccache --stop-server
|