2020-06-16 19:18:11 +03:00
|
|
|
name: Engine CI
|
2020-03-24 15:52:02 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-07-21 15:59:40 +03:00
|
|
|
branches: [main, "release/*"]
|
2020-03-24 15:52:02 +03:00
|
|
|
pull_request:
|
2020-07-21 15:59:40 +03:00
|
|
|
branches: ["*"]
|
2020-03-24 15:52:02 +03:00
|
|
|
|
|
|
|
env:
|
2020-07-10 13:57:42 +03:00
|
|
|
# Please ensure that this is in sync with graalVersion in build.sbt
|
2021-02-22 16:32:55 +03:00
|
|
|
graalVersion: 21.0.0.2
|
2020-07-10 13:57:42 +03:00
|
|
|
# Please ensure that this is in sync with javaVersion in build.sbt
|
2020-07-22 20:28:03 +03:00
|
|
|
javaVersion: 11
|
2020-03-24 15:52:02 +03:00
|
|
|
# Please ensure that this is in sync with project/build.properties
|
2021-02-22 16:32:55 +03:00
|
|
|
sbtVersion: 1.4.7
|
2020-08-07 12:18:09 +03:00
|
|
|
# Please ensure that this is in sync with rustVersion in build.sbt
|
2020-08-03 17:00:12 +03:00
|
|
|
rustToolchain: nightly-2019-11-04
|
2020-03-24 15:52:02 +03:00
|
|
|
|
|
|
|
jobs:
|
2020-10-06 18:45:02 +03:00
|
|
|
test_and_publish:
|
|
|
|
name: Build and Test
|
2020-03-24 15:52:02 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-02-22 16:32:55 +03:00
|
|
|
timeout-minutes: 90
|
2020-03-24 15:52:02 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-04 19:59:05 +03:00
|
|
|
os: [macOS-latest, ubuntu-18.04, windows-latest]
|
2020-03-24 15:52:02 +03:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2020-05-15 11:07:58 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-07-22 20:28:03 +03:00
|
|
|
- name: Enable Developer Command Prompt (Windows)
|
2021-01-15 18:26:51 +03:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.5.0
|
2020-10-27 14:45:10 +03:00
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v2
|
2020-09-22 11:46:29 +03:00
|
|
|
- name: Disable TCP/UDP Offloading (macOS)
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sudo sysctl -w net.link.generic.system.hwcksum_tx=0
|
|
|
|
sudo sysctl -w net.link.generic.system.hwcksum_rx=0
|
2020-09-07 14:24:34 +03:00
|
|
|
- name: Disable TCP/UDP Offloading (Linux)
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
shell: bash
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
- name: Disable TCP/UDP Offloading (Windows)
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
shell: powershell
|
|
|
|
run: >
|
|
|
|
Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6
|
|
|
|
-UdpIPv6
|
2020-08-03 17:00:12 +03:00
|
|
|
- name: Install Rust
|
2020-10-21 17:48:05 +03:00
|
|
|
uses: actions-rs/toolchain@v1.0.6
|
2020-08-03 17:00:12 +03:00
|
|
|
with:
|
|
|
|
toolchain: ${{ env.rustToolchain }}
|
|
|
|
override: true
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Setup conda
|
2020-10-21 17:48:05 +03:00
|
|
|
uses: s-weigand/setup-conda@v1.0.5
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
|
|
|
update-conda: false
|
|
|
|
conda-channels: anaconda, conda-forge
|
|
|
|
- name: Setup Conda Environment on Windows
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
|
|
|
conda create --name enso
|
|
|
|
conda init powershell
|
|
|
|
- name: Activate Conda Environment on Windows
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: conda activate enso
|
|
|
|
- name: Install FlatBuffers Compiler
|
|
|
|
run: conda install --freeze-installed flatbuffers=1.12.0
|
|
|
|
- name: Setup GraalVM Environment
|
2020-07-22 20:28:03 +03:00
|
|
|
uses: ayltai/setup-graalvm@v1
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
2020-07-22 20:28:03 +03:00
|
|
|
graalvm-version: ${{ env.graalVersion }}
|
|
|
|
java-version: ${{ env.javaVersion }}
|
|
|
|
native-image: true
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Set Up SBT
|
2020-10-21 17:48:05 +03:00
|
|
|
shell: bash
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
2020-10-01 12:37:46 +03:00
|
|
|
curl --retry 4 --retry-connrefused -fsSL -o sbt.tgz https://github.com/sbt/sbt/releases/download/v${{env.sbtVersion}}/sbt-${{env.sbtVersion}}.tgz
|
2020-05-15 11:07:58 +03:00
|
|
|
tar -xzf sbt.tgz
|
2020-10-21 17:48:05 +03:00
|
|
|
echo $GITHUB_WORKSPACE/sbt/bin/ >> $GITHUB_PATH
|
2020-04-10 22:24:37 +03:00
|
|
|
|
2020-05-15 11:07:58 +03:00
|
|
|
# Caches
|
|
|
|
- name: Cache SBT
|
2020-06-15 18:48:04 +03:00
|
|
|
uses: actions/cache@v2
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
2020-06-15 18:48:04 +03:00
|
|
|
path: |
|
|
|
|
~/.sbt
|
|
|
|
~/.ivy2/cache
|
|
|
|
~/.cache
|
|
|
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**build.sbt') }}
|
2020-05-15 11:07:58 +03:00
|
|
|
restore-keys: ${{ runner.os }}-sbt-
|
2020-04-24 19:33:27 +03:00
|
|
|
|
2020-10-06 18:45:02 +03:00
|
|
|
# Compile
|
2020-07-01 14:21:13 +03:00
|
|
|
- name: Bootstrap Enso project
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
|
|
|
sbt --no-colors bootstrap
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Build Enso
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
|
|
|
sbt --no-colors compile
|
2020-04-10 22:24:37 +03:00
|
|
|
|
2020-05-15 11:07:58 +03:00
|
|
|
# Tests
|
2020-07-14 14:44:40 +03:00
|
|
|
- name: Setup Tests on Windows
|
|
|
|
if: runner.os == 'Windows'
|
2020-10-21 17:48:05 +03:00
|
|
|
shell: bash
|
2020-07-20 17:13:37 +03:00
|
|
|
run: |
|
2020-10-21 17:48:05 +03:00
|
|
|
echo "CI_TEST_TIMEFACTOR=2" >> $GITHUB_ENV
|
|
|
|
echo "CI_TEST_FLAKY_ENABLE=true" >> $GITHUB_ENV
|
2020-08-28 14:03:09 +03:00
|
|
|
- name: Build the Launcher
|
|
|
|
run: |
|
|
|
|
sleep 1
|
|
|
|
sbt --no-colors launcher/buildNativeImage
|
2020-12-02 18:56:47 +03:00
|
|
|
- name: Build the Runner & Runtime Uberjars
|
|
|
|
run: |
|
|
|
|
sleep 1
|
2021-02-22 16:32:55 +03:00
|
|
|
sbt --no-colors "runtime/clean; engine-runner/assembly"
|
2020-12-02 18:56:47 +03:00
|
|
|
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Test Enso
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
2021-02-22 16:32:55 +03:00
|
|
|
sbt --no-colors "set Global / parallelExecution := false; runtime/clean; compile; test"
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Check Runtime Benchmark Compilation
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
2021-02-22 16:32:55 +03:00
|
|
|
sbt --no-colors "runtime/clean; runtime/Benchmark/compile"
|
2020-07-01 14:21:13 +03:00
|
|
|
- name: Check Language Server Benchmark Compilation
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
|
|
|
sbt --no-colors language-server/Benchmark/compile
|
2020-07-06 16:55:21 +03:00
|
|
|
- name: Check Searcher Benchmark Compilation
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
|
|
|
sbt --no-colors searcher/Benchmark/compile
|
2020-04-10 22:24:37 +03:00
|
|
|
|
2020-10-06 18:45:02 +03:00
|
|
|
# Build Distribution
|
2020-12-09 16:58:11 +03:00
|
|
|
- name: Build the Project Manager Native Image
|
2020-08-27 13:00:01 +03:00
|
|
|
run: |
|
|
|
|
sleep 1
|
2020-12-09 16:58:11 +03:00
|
|
|
sbt --no-colors project-manager/buildNativeImage
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Build the Parser JS Bundle
|
2021-02-22 16:32:55 +03:00
|
|
|
# The builds are run on 3 platforms, but
|
|
|
|
# Flatbuffer schemas are platform agnostic, so they just need to be
|
|
|
|
# uploaded from one of the runners.
|
2020-08-07 12:18:09 +03:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-22 16:32:55 +03:00
|
|
|
run: sbt --no-colors syntaxJS/fullOptJS
|
2020-05-04 15:36:05 +03:00
|
|
|
|
2020-08-07 12:18:09 +03:00
|
|
|
# Prepare distributions
|
2020-08-19 15:24:31 +03:00
|
|
|
# The version used in filenames is based on the version of the launcher.
|
|
|
|
# Currently launcher and engine versions are tied to each other so they
|
|
|
|
# can be used interchangeably like this. If in the future the versions
|
|
|
|
# become independent, this may require updating to use proper versions
|
|
|
|
# for each component.
|
2020-08-07 12:18:09 +03:00
|
|
|
- name: Prepare Distribution Version (Unix)
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-08-19 15:24:31 +03:00
|
|
|
DIST_VERSION=$(./enso version --json --only-launcher | jq -r '.version')
|
2020-10-21 17:48:05 +03:00
|
|
|
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
|
2020-08-07 12:18:09 +03:00
|
|
|
|
|
|
|
- name: Prepare Distribution Version (Windows)
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-08-19 15:24:31 +03:00
|
|
|
DIST_VERSION=$(./enso.exe version --json --only-launcher | jq -r '.version')
|
2020-10-21 17:48:05 +03:00
|
|
|
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
|
2020-08-07 12:18:09 +03:00
|
|
|
|
|
|
|
# Currently the only architecture supported by Github runners is amd64
|
|
|
|
- name: Prepare Distribution Environment
|
|
|
|
shell: bash
|
2020-12-09 16:58:11 +03:00
|
|
|
run: >
|
|
|
|
DIST_OS=$(echo ${{ runner.os }} | awk '{print tolower($0)}') bash
|
|
|
|
tools/ci/prepare-distribution-env.sh
|
2020-08-07 12:18:09 +03:00
|
|
|
|
2020-12-09 16:58:11 +03:00
|
|
|
- name: Prepare Launcher Distribution
|
2020-08-07 12:18:09 +03:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-12-09 16:58:11 +03:00
|
|
|
sleep 1
|
2021-01-15 18:26:51 +03:00
|
|
|
sbt buildLauncherDistribution
|
2020-08-07 12:18:09 +03:00
|
|
|
|
|
|
|
# The way artifacts are uploaded currently does not preserve the
|
|
|
|
# executable bits for Unix. However putting artifacts into a ZIP would
|
|
|
|
# create a twice nested ZIP file. For now, users downloading artifacts
|
|
|
|
# from the CI builds have to set the bit themselves.
|
2020-12-09 16:58:11 +03:00
|
|
|
# So the following line has been removed from this step, as it does
|
2020-08-07 12:18:09 +03:00
|
|
|
# nothing useful:
|
|
|
|
# chmod +x $ENGINE_DIST_DIR/bin/enso
|
|
|
|
- name: Prepare Engine Distribution
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-12-09 16:58:11 +03:00
|
|
|
sleep 1
|
2021-02-22 16:32:55 +03:00
|
|
|
sbt "runtime/clean; buildEngineDistribution"
|
2020-12-09 16:58:11 +03:00
|
|
|
|
|
|
|
- name: Prepare Project Manager Distribution
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sleep 1
|
2021-01-15 18:26:51 +03:00
|
|
|
sbt buildProjectManagerDistribution
|
2020-08-07 12:18:09 +03:00
|
|
|
|
2020-10-06 18:45:02 +03:00
|
|
|
# Test Distribution
|
2020-10-27 14:45:10 +03:00
|
|
|
- name: Prepare Engine Test Environment
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
go get -v github.com/ahmetb/go-httpbin/cmd/httpbin
|
|
|
|
$(go env GOPATH)/bin/httpbin -host :8080 &
|
|
|
|
|
2020-10-06 18:45:02 +03:00
|
|
|
- name: Test Engine Distribution (Unix)
|
|
|
|
shell: bash
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
run: |
|
2020-10-29 08:48:48 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso --run test/Tests
|
2021-02-12 18:27:54 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso --run test/Table_Tests
|
2021-02-25 16:48:18 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso --run test/Database_Tests
|
2021-02-12 18:27:54 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso --run test/Geo_Tests
|
2020-10-06 18:45:02 +03:00
|
|
|
|
|
|
|
- name: Test Engine Distribution (Windows)
|
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
2020-10-29 08:48:48 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso.bat --run test/Tests
|
2020-11-05 18:53:50 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso.bat --run test/Table_Tests
|
2021-02-25 16:48:18 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso.bat --run test/Database_Tests
|
2021-02-12 18:27:54 +03:00
|
|
|
$ENGINE_DIST_DIR/bin/enso.bat --run test/Geo_Tests
|
2020-11-05 18:53:50 +03:00
|
|
|
|
2020-05-15 11:07:58 +03:00
|
|
|
# Publish
|
2020-08-07 12:18:09 +03:00
|
|
|
- name: Publish the Engine Distribution Artifact
|
2020-10-21 17:48:05 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
2021-01-15 18:26:51 +03:00
|
|
|
name: ${{ env.ENGINE_DIST_NAME }}
|
2020-08-07 12:18:09 +03:00
|
|
|
path: ${{ env.ENGINE_DIST_ROOT }}
|
2020-12-09 16:58:11 +03:00
|
|
|
- name: Publish the Launcher
|
2020-08-07 12:18:09 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-01-15 18:26:51 +03:00
|
|
|
name: ${{ env.LAUNCHER_DIST_NAME }}
|
2020-08-07 12:18:09 +03:00
|
|
|
path: ${{ env.LAUNCHER_DIST_ROOT }}
|
2020-12-09 16:58:11 +03:00
|
|
|
- name: Publish the Project Manager
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-01-15 18:26:51 +03:00
|
|
|
name: ${{ env.PROJECTMANAGER_DIST_NAME }}
|
2020-12-09 16:58:11 +03:00
|
|
|
path: ${{ env.PROJECTMANAGER_DIST_ROOT }}
|
2020-08-07 12:18:09 +03:00
|
|
|
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Prepare the FlatBuffers Schemas for Upload
|
2020-08-07 12:18:09 +03:00
|
|
|
# The builds are run on 3 platforms, but Flatbuffer schemas are platform
|
|
|
|
# agnostic, so they just need to be uploaded from one of the runners.
|
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
mkdir fbs-upload
|
|
|
|
cp -r "engine/language-server/src/main/schema" fbs-upload/fbs-schema/
|
|
|
|
zip -r -m -ll "fbs-upload/fbs-schema.zip" "fbs-upload/fbs-schema/"
|
|
|
|
- name: Publish the FlatBuffers Schemas
|
2020-08-07 12:18:09 +03:00
|
|
|
if: runner.os == 'Linux'
|
2020-10-21 17:48:05 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
|
|
|
name: Engine Protocol FlatBuffers Schemas
|
|
|
|
path: ./fbs-upload/fbs-schema.zip
|
|
|
|
- name: Prepare Parser JS Bundle for Upload
|
2020-08-07 12:18:09 +03:00
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
mkdir parser-upload
|
|
|
|
cp ./target/scala-parser.js parser-upload
|
|
|
|
- name: Publish the Parser JS Bundle
|
2020-08-07 12:18:09 +03:00
|
|
|
if: runner.os == 'Linux'
|
2020-10-21 17:48:05 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-05-15 11:07:58 +03:00
|
|
|
with:
|
|
|
|
name: Parser JS Bundle
|
|
|
|
path: ./target/scala-parser.js
|
2020-07-10 13:57:42 +03:00
|
|
|
- name: Publish the Manifest
|
2020-08-07 12:18:09 +03:00
|
|
|
if: runner.os == 'Linux'
|
2020-07-10 13:57:42 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: manifest
|
2020-12-09 16:58:11 +03:00
|
|
|
path: ${{ env.ENGINE_DIST_DIR }}/manifest.yaml
|
2020-08-07 12:18:09 +03:00
|
|
|
|
|
|
|
# Publish FlatBuffer Schemas and Parser Bundle to S3
|
2020-05-15 11:07:58 +03:00
|
|
|
- name: Prepare AWS Session
|
2020-08-07 12:18:09 +03:00
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
|
2020-06-23 19:08:52 +03:00
|
|
|
${{ secrets.ARTEFACT_S3_ACCESS_KEY_ID }}
|
|
|
|
${{ secrets.ARTEFACT_S3_SECRET_ACCESS_KEY }}
|
2020-05-15 11:07:58 +03:00
|
|
|
us-west-2
|
|
|
|
text
|
|
|
|
EOF
|
|
|
|
- name: Upload Parser JS Bundle to S3
|
2020-08-07 12:18:09 +03:00
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
aws s3 sync ./parser-upload s3://packages-luna/parser-js/nightly/`git rev-parse HEAD` --profile s3-upload --acl public-read --delete
|
|
|
|
- name: Upload FlatBuffers Schemas to S3
|
2020-08-07 12:18:09 +03:00
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
aws s3 sync ./fbs-upload s3://packages-luna/fbs-schema/nightly/`git rev-parse HEAD` --profile s3-upload --acl public-read --delete
|
|
|
|
- name: Teardown AWS Session
|
2020-08-07 12:18:09 +03:00
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Linux'
|
2020-05-15 11:07:58 +03:00
|
|
|
run: |
|
|
|
|
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
|
|
|
|
null
|
|
|
|
null
|
|
|
|
null
|
|
|
|
text
|
|
|
|
EOF
|