Skip to content

Commit

Permalink
testing cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
06kellyjac committed Jun 22, 2020
1 parent 6cc900e commit 5eb85e8
Showing 1 changed file with 135 additions and 0 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: ci

on:
- push
- pull_request

jobs:
build:
name: ${{ matrix.config.variant }} ${{ 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:
# 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.
# Don't fast-fail on tag build because publishing binaries shouldn't be
# prevented if 'cargo publish' fails (which can be a false negative).
fail-fast:
${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
matrix:
config:

- os: ubuntu-16.04
target: aarch64-unknown-linux-gnu
variant: release

env:
CARGO_VARIANT_FLAG: ${{ matrix.config.variant == 'release' && '--release' || '' }}

CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full

steps:
- name: Configure git
run: git config --global core.symlinks true

- name: Clone repository
uses: actions/checkout@v1
with:
fetch-depth: 5
submodules: recursive

- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.44.1

- name: Install python
uses: actions/setup-python@v1
with:
python-version: 2.7.x
architecture: x64

- name: cross deps
run: |
which rustup
which cargo
which docker
docker ps
- name: Install cross
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross
- name: Log versions
run: |
node -v
python --version
rustc --version
cargo --version
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/target/cargo. 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)/target/cargo"

- name: Build release
run: cross build --release --locked --target aarch64-unknown-linux-gnu

# - name: Test release
# run: cross test --release --locked --target aarch64-unknown-linux-gnu

- name: Check some vals Deno
run: |
echo deno
ls -al target/${{ matrix.config.target }}/${{ matrix.config.variant }}/deno
echo gn_out
ls -al target/${{ matrix.config.target }}/${{ matrix.config.variant }}/gn_out
echo cache
ls -al target/${{ matrix.config.target }}/${{ matrix.config.variant }}/incremental || true
echo cargo_home var
echo $CARGO_HOME
echo cargo_home
ls -al target/cargo || true
- name: Move Deno
run: |
mv target/${{ matrix.config.target }}/${{ matrix.config.variant }}/deno target/release/deno
- name: Pre-release (linux)
if: |
startsWith(matrix.config.os, 'ubuntu') &&
matrix.config.variant == 'release'
run: |
cd target/release
zip -r deno-${{ matrix.config.target }}.zip deno
# - name: Binary publish
# uses: softprops/action-gh-release@v1
# if: github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}

- name: Release
uses: softprops/action-gh-release@v1
if: |
matrix.config.variant == 'release' &&
startsWith(github.ref, 'refs/tags/') &&
!startsWith(github.ref, 'refs/tags/std/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
target/release/deno-aarch64-unknown-linux-gnu.zip
draft: true

0 comments on commit 5eb85e8

Please sign in to comment.