enso/.github/workflows/scala.yml

315 lines
11 KiB
YAML
Raw Normal View History

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
2020-08-28 14:03:09 +03:00
graalVersion: 20.2.0
2020-07-10 13:57:42 +03:00
# Please ensure that this is in sync with javaVersion in build.sbt
javaVersion: 11
2020-03-24 15:52:02 +03:00
# Please ensure that this is in sync with project/build.properties
sbtVersion: 1.4.1
2020-08-07 12:18:09 +03:00
# Please ensure that this is in sync with rustVersion in build.sbt
rustToolchain: nightly-2019-11-04
2020-04-10 22:24:37 +03:00
excludedPaths: |
.github/PULL_REQUEST_TEMPLATE.md
.github/CODEOWNERS
.github/ISSUE_TEMPLATE/*
/doc/*
.gitignore
.scalafmt.conf
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
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 }}
2020-12-03 16:01:16 +03:00
timeout-minutes: 60
2020-03-24 15:52:02 +03:00
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, 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
- name: Enable Developer Command Prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1.5.0
- name: Setup Go
uses: actions/setup-go@v2
- 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
- name: Install Rust
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
2020-05-15 11:07:58 +03:00
- name: Setup conda
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
uses: ayltai/setup-graalvm@v1
2020-05-15 11:07:58 +03:00
with:
graalvm-version: ${{ env.graalVersion }}
java-version: ${{ env.javaVersion }}
native-image: true
2020-05-15 11:07:58 +03:00
- name: Set Up SBT
shell: bash
2020-05-15 11:07:58 +03:00
run: |
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
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
uses: actions/cache@v2
2020-05-15 11:07:58 +03:00
with:
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-10-06 18:45:02 +03:00
# Compile
2020-07-01 14:21:13 +03:00
- name: Bootstrap Enso project
run: |
sleep 1
sbt --no-colors bootstrap
2020-05-15 11:07:58 +03:00
- name: Build Enso
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'
shell: bash
run: |
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
shell: bash
2020-08-28 14:03:09 +03:00
run: |
sleep 1
sbt --no-colors launcher/buildNativeImage
- name: Build the Runner & Runtime Uberjars
run: |
sleep 1
sbt --no-colors engine-runner/assembly
2020-05-15 11:07:58 +03:00
- name: Test Enso
run: |
sleep 1
sbt --no-colors "set Global / parallelExecution := false; test"
2020-05-15 11:07:58 +03:00
- name: Check Runtime Benchmark Compilation
run: |
sleep 1
sbt --no-colors runtime/Benchmark/compile
2020-07-01 14:21:13 +03:00
- name: Check Language Server Benchmark Compilation
run: |
sleep 1
sbt --no-colors language-server/Benchmark/compile
2020-07-06 16:55:21 +03:00
- name: Check Searcher Benchmark Compilation
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
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
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: sbt -no-colors syntaxJS/fullOptJS
2020-08-07 12:18:09 +03:00
# Prepare distributions
# 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: |
DIST_VERSION=$(./enso version --json --only-launcher | jq -r '.version')
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: |
DIST_VERSION=$(./enso.exe version --json --only-launcher | jq -r '.version')
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
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
sbt buildEngineDistribution
2020-12-09 16:58:11 +03:00
- name: Prepare Project Manager Distribution
shell: bash
run: |
sleep 1
sbt buildProjectManagerDistribution
2020-08-07 12:18:09 +03:00
2020-10-06 18:45:02 +03:00
# Test Distribution
- 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: |
$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
$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: |
$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-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
uses: actions/upload-artifact@v2
2020-05-15 11:07:58 +03:00
with:
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:
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:
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'
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'
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