2020-03-24 22:35:42 +03:00
|
|
|
name: Enso CI
|
2020-03-24 15:52:02 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Please ensure that this is in sync with graalAPIVersion in build.sbt
|
|
|
|
graalVersion: 20.0.0
|
|
|
|
javaVersion: java8
|
|
|
|
# Please ensure that this is in sync with project/build.properties
|
2020-04-10 22:24:37 +03:00
|
|
|
sbtVersion: 1.3.9
|
|
|
|
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-03-25 10:53:33 +03:00
|
|
|
# This job is responsible for testing the codebase
|
2020-03-24 22:35:42 +03:00
|
|
|
test:
|
|
|
|
name: Test
|
2020-03-24 15:52:02 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-03-24 22:35:42 +03:00
|
|
|
timeout-minutes: 30
|
2020-03-24 15:52:02 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, macOS-latest, ubuntu-latest]
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-04-17 16:47:58 +03:00
|
|
|
- name: Setup conda
|
|
|
|
uses: s-weigand/setup-conda@v1
|
|
|
|
with:
|
|
|
|
update-conda: true
|
|
|
|
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 flatbuffers=1.12.0
|
2020-03-24 22:35:42 +03:00
|
|
|
- name: Setup GraalVM Environment
|
|
|
|
uses: DeLaGuardo/setup-graalvm@2.0
|
|
|
|
with:
|
|
|
|
graalvm-version: ${{ env.graalVersion }}.${{ env.javaVersion }}
|
|
|
|
- name: Set Up SBT
|
|
|
|
run: |
|
|
|
|
curl -fSL -o sbt.tgz https://piccolo.link/sbt-${{env.sbtVersion}}.tgz
|
|
|
|
tar -xzf sbt.tgz
|
2020-04-10 22:24:37 +03:00
|
|
|
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
|
|
|
|
|
|
|
|
# Caches (fragile, depends on the dependencies of the parser)
|
|
|
|
- name: Cache Ivy
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: /home/runner/.ivy2/cache
|
|
|
|
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
|
|
|
|
restore-keys: ${{ runner.os }}-ivy-
|
|
|
|
- name: Cache SBT
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: /home/runner/.sbt
|
2020-04-15 16:06:27 +03:00
|
|
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-sbt-
|
|
|
|
- name: Cache SBT Project
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: ./project/target
|
|
|
|
key: ${{ runner.os }}-sbt-project-${{ hashFiles('project/**') }}
|
|
|
|
restore-keys: ${{ runner.os }}-sbt-project-
|
|
|
|
- name: Cache Logger (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/logger/.jvm
|
|
|
|
key: ${{ runner.os }}-logger-jvm-${{ hashFiles('lib/logger/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-logger-jvm-
|
|
|
|
- name: Cache Flexer (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/flexer/.jvm
|
|
|
|
key: ${{ runner.os }}-flexer-jvm-${{ hashFiles('lib/flexer/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-flexer-jvm-
|
|
|
|
- name: Cache Syntax Definition (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/definition/.jvm
|
|
|
|
key: ${{ runner.os }}-syntax-definition-jvm-${{ hashFiles('lib/syntax/definition/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-defintion-jvm-
|
|
|
|
- name: Cache Syntax Specialization (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/specialization/jvm
|
|
|
|
key: ${{ runner.os }}-syntax-specialization-jvm-${{ hashFiles('lib/syntax/specialization/shared/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-specialization-jvm-
|
|
|
|
|
|
|
|
# Tests
|
2020-03-24 22:35:42 +03:00
|
|
|
- name: Test Enso
|
|
|
|
run: sbt --no-colors test
|
|
|
|
- name: Benchmark the Parser
|
|
|
|
run: sbt -no-colors syntax/bench
|
|
|
|
- name: Check Runtime Benchmark Compilation
|
|
|
|
run: sbt -no-colors runtime/Benchmark/compile
|
|
|
|
- name: Build the Uberjar
|
|
|
|
run: sbt -no-colors runner/assembly
|
|
|
|
- name: Test the Uberjar
|
2020-04-14 19:00:51 +03:00
|
|
|
run: ./enso.jar --run tools/ci/Test.enso
|
2020-04-10 22:24:37 +03:00
|
|
|
|
2020-03-25 10:53:33 +03:00
|
|
|
# This job is responsible for building the artifacts
|
2020-04-10 22:24:37 +03:00
|
|
|
build:
|
2020-03-24 22:35:42 +03:00
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
2020-03-25 10:53:33 +03:00
|
|
|
- name: Checkout (PR)
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
if: github.event_name == 'pull_request'
|
2020-03-24 22:35:42 +03:00
|
|
|
with:
|
2020-03-25 10:53:33 +03:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Checkout (Branch)
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
if: github.event_name != 'pull_request'
|
2020-04-17 16:47:58 +03:00
|
|
|
- name: Setup conda
|
|
|
|
uses: s-weigand/setup-conda@v1
|
|
|
|
with:
|
|
|
|
update-conda: true
|
|
|
|
conda-channels: anaconda, conda-forge
|
|
|
|
- name: Install FlatBuffers Compiler
|
|
|
|
run: conda install flatbuffers=1.12.0
|
2020-03-24 22:35:42 +03:00
|
|
|
- name: Setup GraalVM Environment
|
|
|
|
uses: DeLaGuardo/setup-graalvm@2.0
|
|
|
|
with:
|
|
|
|
graalvm-version: ${{ env.graalVersion }}.${{ env.javaVersion }}
|
|
|
|
- name: Set Up SBT
|
|
|
|
run: |
|
|
|
|
curl -fSL -o sbt.tgz https://piccolo.link/sbt-${{env.sbtVersion}}.tgz
|
|
|
|
tar -xzf sbt.tgz
|
2020-04-10 22:24:37 +03:00
|
|
|
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
|
|
|
|
|
|
|
|
# Caches (fragile, depends on the dependencies of the parser)
|
|
|
|
- name: Cache Ivy
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: /home/runner/.ivy2/cache
|
|
|
|
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
|
|
|
|
restore-keys: ${{ runner.os }}-ivy-
|
|
|
|
- name: Cache SBT
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: /home/runner/.sbt
|
2020-04-15 16:06:27 +03:00
|
|
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-sbt-
|
|
|
|
- name: Cache SBT Project
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: ./project/target
|
|
|
|
key: ${{ runner.os }}-sbt-project-${{ hashFiles('project/**') }}
|
|
|
|
restore-keys: ${{ runner.os }}-sbt-project-
|
|
|
|
- name: Cache Logger (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/logger/.jvm
|
|
|
|
key: ${{ runner.os }}-logger-jvm-${{ hashFiles('lib/logger/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-logger-jvm-
|
|
|
|
- name: Cache Flexer (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/flexer/.jvm
|
|
|
|
key: ${{ runner.os }}-flexer-jvm-${{ hashFiles('lib/flexer/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-flexer-jvm-
|
|
|
|
- name: Cache Syntax Definition (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/definition/.jvm
|
|
|
|
key: ${{ runner.os }}-syntax-definition-jvm-${{ hashFiles('lib/syntax/definition/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-defintion-jvm-
|
|
|
|
- name: Cache Syntax Specialization (JVM)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/specialization/jvm
|
|
|
|
key: ${{ runner.os }}-syntax-specialization-jvm-${{ hashFiles('lib/syntax/specialization/shared/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-specialization-jvm-
|
|
|
|
- name: Cache Logger (JS)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/logger/.js
|
|
|
|
key: ${{ runner.os }}-logger-js-${{ hashFiles('lib/logger/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-logger-js-
|
|
|
|
- name: Cache Flexer (JS)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/flexer/.js
|
|
|
|
key: ${{ runner.os }}-flexer-js-${{ hashFiles('lib/flexer/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-flexer-js-
|
|
|
|
- name: Cache Syntax Definition (JS)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/definition/.js
|
|
|
|
key: ${{ runner.os }}-syntax-definition-js-${{ hashFiles('lib/syntax/definition/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-defintion-js-
|
|
|
|
- name: Cache Syntax Specialization (JS)
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-04-14 19:00:51 +03:00
|
|
|
path: ./lib/syntax/specialization/js
|
|
|
|
key: ${{ runner.os }}-syntax-specialization-js-${{ hashFiles('lib/syntax/specialization/shared/src/**') }}
|
2020-04-10 22:24:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-syntax-specialization-js-
|
|
|
|
|
|
|
|
# Builds
|
2020-03-24 22:35:42 +03:00
|
|
|
- name: Build the Uberjar
|
|
|
|
run: sbt --no-colors runner/assembly
|
|
|
|
- name: Publish the Uberjar
|
|
|
|
uses: actions/upload-artifact@v1.0.0
|
|
|
|
with:
|
|
|
|
name: Enso CLI
|
|
|
|
path: ./enso.jar
|
|
|
|
- name: Build the Parser JS Bundle
|
|
|
|
run: sbt -no-colors syntaxJS/fullOptJS
|
|
|
|
- name: Publish the Parser JS Bundle
|
|
|
|
uses: actions/upload-artifact@v1.0.0
|
|
|
|
with:
|
|
|
|
name: Parser JS Bundle
|
|
|
|
path: ./target/scala-parser.js
|
|
|
|
- name: Prepare Parser JS Bundle for Upload
|
|
|
|
run: |
|
|
|
|
mkdir parser_upload
|
|
|
|
cp ./target/scala-parser.js parser_upload
|
|
|
|
- name: Prepare AWS Session
|
|
|
|
run: |
|
|
|
|
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
|
|
|
|
${{ secrets.PARSER_S3_ACCESS_KEY_ID }}
|
|
|
|
${{ secrets.PARSER_S3_SECRET_ACCESS_KEY }}
|
|
|
|
us-west-2
|
|
|
|
text
|
|
|
|
EOF
|
|
|
|
- name: Upload Parser JS Bundle to S3
|
|
|
|
run: |
|
2020-03-25 10:53:33 +03:00
|
|
|
aws s3 sync ./parser_upload s3://packages-luna/parser-js/nightly/`git rev-parse HEAD` --profile s3-upload --acl public-read --delete
|
2020-03-24 22:35:42 +03:00
|
|
|
- name: Teardown AWS Session
|
|
|
|
run: |
|
|
|
|
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
|
|
|
|
null
|
|
|
|
null
|
|
|
|
null
|
|
|
|
text
|
|
|
|
EOF
|