Skip to content

Commit

Permalink
Merge remote-tracking branch 'denoland/master' into middle2h+
Browse files Browse the repository at this point in the history
* denoland/master: (35 commits)
  Ignore flaky test cafile_info (denoland#4517)
  fix(inspector): proper error message on port collision (denoland#4514)
  feat: Added colors to doc output (denoland#4518)
  v0.38.0
  feat: Add "deno doc" subcommand (denoland#4500)
  Update to Prettier 2 and use ES Private Fields (denoland#4498)
  upgrade: dprint 0.9.6 (denoland#4509)
  upgrade: rusty_v8 to v0.3.9 (denoland#4505)
  feat: Support Inspector / Chrome Devtools (denoland#4484)
  Improve isatty and kill API docs; Deno.kill() - throw on Windows (denoland#4497)
  refactor: rename ConsoleOptions to InspectOptions (denoland#4493)
  upgrade: dprint 0.9.5 (denoland#4491)
  feat: window.close() (denoland#4474)
  errors: replace .lines with explicit .split newline (denoland#4483)
  doc: improve various API docs and include examples (denoland#4486)
  hide source line if error message longer than 150 chars (denoland#4487)
  fix: add fsEvent notify::Error casts (denoland#4488)
  feat: add queueMicrotask to d.ts (denoland#4477)
  Revert "avoid using same port number for test (denoland#4147)"
  docs: update manual about how to run tests for std (denoland#4462)
  ...
  • Loading branch information
dubiousjim committed Mar 29, 2020
2 parents 0c1b37f + 6ae4744 commit c2c2f2e
Show file tree
Hide file tree
Showing 391 changed files with 9,282 additions and 3,338 deletions.
2 changes: 2 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
189 changes: 87 additions & 102 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,37 @@ on: [push, pull_request]

jobs:
build:
name: ${{ matrix.kind }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
if: |
github.event_name == 'push' ||
!startsWith(github.event.pull_request.head.label, 'denoland:')
runs-on: ${{ matrix.config.os }}
timeout-minutes: 60
strategy:
matrix:
os: [macOS-latest, ubuntu-16.04, windows-2019]
kind: ['test_release', 'test_debug', 'bench', 'lint']
exclude:
- os: windows-2019
kind: 'bench'
- os: macOS-latest
kind: 'bench'

- os: windows-2019
kind: 'lint'
config:
- os: macOS-latest
kind: 'lint'

kind: test_release
- os: windows-2019
kind: 'test_debug'
- os: macOS-latest
kind: 'test_debug'
kind: test_release
- os: ubuntu-16.04
kind: test_release
- os: ubuntu-16.04
kind: test_debug
- os: ubuntu-16.04
kind: bench
- os: ubuntu-16.04
kind: lint

# Always run master branch builds to completion. This allows the cache to
# stay mostly up-to-date in situations where a single job fails due to
# e.g. a flaky test.
fail-fast:
${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}

env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
V8_BINARY: true

steps:
- name: Configure git
Expand All @@ -46,35 +50,18 @@ jobs:
submodules: true

- name: Create source tarballs (release, linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
run: |
mkdir -p target/release
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
# Cache https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
tar --exclude=.cargo_home --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
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.42.0"

- name: Install clippy and rustfmt
if: matrix.kind == 'lint'
if: matrix.config.kind == 'lint'
run: |
rustup component add clippy
rustup component add rustfmt
Expand All @@ -86,92 +73,74 @@ jobs:
architecture: x64

- name: Remove unused versions of Python
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.config.os, 'windows')
run: |-
$env:PATH -split ";" |
Where-Object { Test-Path "$_\python.exe" } |
Select-Object -Skip 1 |
ForEach-Object { Move-Item "$_" "$_.disabled" }
- 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: |
echo ::add-path::`pwd`/third_party/prebuilt/linux64
echo ::add-path::`pwd`/target/release
- name: Environment (mac)
if: startsWith(matrix.os, 'macOS')
run: |
echo ::add-path::`pwd`/third_party/prebuilt/mac
echo ::add-path::`pwd`/target/release
- name: Environment (windows)
if: startsWith(matrix.os, 'windows')
run: |
echo ::add-path::$(pwd)\third_party\prebuilt\win
echo ::add-path::$(pwd)\target\release
- name: Log versions
run: |
node -v
python --version
rustc --version
cargo --version
- name: Start sccache (azure)
if: startsWith(matrix.os, 'windows') == false
env:
SCCACHE_AZURE_BLOB_CONTAINER: deno-sccache2
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING || 'DefaultEndpointsProtocol=https;AccountName=denosccache;EndpointSuffix=core.windows.net' }}
SCCACHE_IDLE_TIMEOUT: 0
run: sccache --start-server

# TODO(ry) We want to use Azure because it's cheaper. However sccache on
# Windows has a bug when using Azure. The bug manifests itself as a
# "multiple input files" error message.
- name: Start sccache (s3)
if: startsWith(matrix.os, 'windows')
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
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "::set-env name=CARGO_HOME::$(pwd)/.cargo_home"

- name: Cache
uses: actions/cache@master
with:
# Note: crates from the denoland/deno git repo always get rebuilt,
# and their outputs ('deno', 'libdeno.rlib' etc.) are quite big,
# so we cache only those subdirectories of target/{debug|release} that
# contain the build output for crates that come from the registry.
path: |-
.cargo_home
target/*/.*
target/*/build
target/*/deps
target/*/gn_out
key:
${{ matrix.config.os }}-${{ matrix.config.kind }}-${{ hashFiles('Cargo.lock') }}

- name: lint.py
if: matrix.kind == 'lint'
if: matrix.config.kind == 'lint'
run: python ./tools/lint.py

- name: test_format.py
if: matrix.kind == 'lint'
if: matrix.config.kind == 'lint'
run: python ./tools/test_format.py

- name: Build release
if: matrix.kind == 'test_release' || matrix.kind == 'bench'
if: matrix.config.kind == 'test_release' || matrix.config.kind == 'bench'
run: cargo build --release --locked --all-targets

- name: Build debug
if: matrix.kind == 'test_debug'
if: matrix.config.kind == 'test_debug'
run: cargo build --locked --all-targets

- name: Test release
if: matrix.kind == 'test_release'
if: matrix.config.kind == 'test_release'
run: cargo test --release --locked --all-targets

- name: Test debug
if: matrix.kind == 'test_debug'
if: matrix.config.kind == 'test_debug'
run: cargo test --locked --all-targets

- name: Run Benchmarks
if: matrix.kind == 'bench'
if: matrix.config.kind == 'bench'
run: python ./tools/benchmark.py --release

- name: Post Benchmarks
if: matrix.kind == 'bench' && github.ref == 'refs/heads/master' && github.repository == 'denoland/deno'
if: matrix.config.kind == 'bench' && github.ref == 'refs/heads/master' && github.repository == 'denoland/deno'
env:
DENOBOT_PAT: ${{ secrets.DENOBOT_PAT }}
run: |
Expand All @@ -185,42 +154,61 @@ jobs:
git push origin gh-pages
- name: Worker info
if: matrix.kind == 'bench'
if: matrix.config.kind == 'bench'
run: |
cat /proc/cpuinfo
cat /proc/meminfo
- name: Pre-release (linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test_release'
run: gzip -f -S _linux_x64.gz target/release/deno
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.kind == 'test_release'
run: |
cd target/release
# New filename
zip -r deno-x86_64-unknown-linux-gnu.zip deno
# Old filename (remove once deno_install updated)
gzip -f -S _linux_x64.gz deno
- name: Pre-release (mac)
if: startsWith(matrix.os, 'macOS') && matrix.kind == 'test_release'
run: gzip -f -S _osx_x64.gz target/release/deno
if: startsWith(matrix.config.os, 'macOS') && matrix.config.kind == 'test_release'
run: |
cd target/release
# New filename
zip -r deno-x86_64-apple-darwin.zip deno
# Old filename (remove once deno_install updated)
gzip -f -S _osx_x64.gz deno
- name: Pre-release (windows)
if: startsWith(matrix.os, 'windows') && matrix.kind == 'test_release'
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno_win_x64.zip
if: startsWith(matrix.config.os, 'windows') && matrix.config.kind == 'test_release'
run: |
# Old filename (remove once deno_install updated)
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno_win_x64.zip
# New filename
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip
- name: Release
uses: softprops/action-gh-release@v1
if: matrix.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
# Old filenames (remove once deno_install updated)
target/release/deno_win_x64.zip
target/release/deno_linux_x64.gz
target/release/deno_osx_x64.gz
# New filenames
target/release/deno-x86_64-pc-windows-msvc.zip
target/release/deno-x86_64-unknown-linux-gnu.zip
target/release/deno-x86_64-apple-darwin.zip
target/release/deno_src.tar.gz
draft: true

- name: Publish
if: >
startsWith(github.ref, 'refs/tags/') &&
github.repository == 'denoland/deno' &&
matrix.kind == 'test_release' &&
startsWith(matrix.os, 'ubuntu')
matrix.config.kind == 'test_release' &&
startsWith(matrix.config.os, 'ubuntu')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
Expand All @@ -232,6 +220,3 @@ jobs:
cd ../cli
sleep 30
cargo publish
- name: Stop sccache
run: sccache --stop-server
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.pyc
*.swp

/.cargo_home/
/.idea/
/.vscode/
gclient_config.py_entries
Expand Down
Loading

0 comments on commit c2c2f2e

Please sign in to comment.