Skip to content

Commit

Permalink
Use Environment Files in Actions (#1218)
Browse files Browse the repository at this point in the history
Updates and/or pins versions of some of the GitHub Actions that we use.
  • Loading branch information
radeusgd authored Oct 21, 2020
1 parent 207aaac commit 0740905
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 49 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ on:
- "*"

env:
# Please ensure that this is in sync with graalAPIVersion in build.sbt
# Please ensure that this is in sync with graalVersion in build.sbt
graalVersion: 20.2.0
javaVersion: java11
# Please ensure that this is in sync with javaVersion in build.sbt
javaVersion: 11
# Please ensure that this is in sync with project/build.properties
sbtVersion: 1.3.13
# Please ensure that this is in sync with rustVersion in build.sbt
rustToolchain: nightly-2019-11-04

jobs:
Expand Down Expand Up @@ -43,26 +45,27 @@ jobs:

# Set Up Environment
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
- name: Setup conda
uses: s-weigand/setup-conda@v1
uses: s-weigand/setup-conda@v1.0.5
with:
update-conda: false
conda-channels: anaconda, conda-forge
- name: Install FlatBuffers Compiler
run: conda install --freeze-installed flatbuffers=1.12.0
- name: Setup GraalVM Environment
uses: DeLaGuardo/setup-graalvm@2.0
uses: ayltai/setup-graalvm@v1
with:
graalvm-version: ${{ env.graalVersion }}.${{ env.javaVersion }}
graalvm-version: ${{ env.graalVersion }}
java-version: ${{ env.javaVersion }}
- name: Set Up SBT
run: |
curl --retry 4 --retry-connrefused -fsSL -o sbt.tgz https://github.com/sbt/sbt/releases/download/v${{env.sbtVersion}}/sbt-${{env.sbtVersion}}.tgz
tar -xzf sbt.tgz
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
echo $GITHUB_WORKSPACE/sbt/bin/ >> $GITHUB_PATH
# Caches
- name: Cache SBT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/legal-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
-UdpIPv6
# TODO [RW] Rust will be needed by #1187
# - name: Install Rust
# uses: actions-rs/toolchain@v1
# uses: actions-rs/toolchain@v1.0.6
# with:
# toolchain: ${{ env.rustToolchain }}
# override: true
Expand All @@ -69,7 +69,7 @@ jobs:
run: |
curl --retry 4 --retry-connrefused -fsSL -o sbt.tgz https://github.com/sbt/sbt/releases/download/v${{env.sbtVersion}}/sbt-${{env.sbtVersion}}.tgz
tar -xzf sbt.tgz
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
echo $GITHUB_WORKSPACE/sbt/bin/ >> $GITHUB_PATH
# Caches
- name: Cache SBT
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release-update-broken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ jobs:
run: |
ref=${{ github.ref }}
tag=${ref#"refs/tags/"}
echo ::set-env name=TAG::$tag
echo "TAG=$tag" >> $GITHUB_ENV
- name: Check if Broken Mark is Present
shell: bash
run: |
BROKEN="::set-env name=IS_BROKEN::true"
NOT_BROKEN="::set-env name=IS_BROKEN::false"
curl https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG }} > release.json
./repo/tools/ci/releases/is-broken.js release.json > url.txt && echo $BROKEN || echo $NOT_BROKEN
echo ::set-env name=BROKEN_URL::$(cat url.txt)
./repo/tools/ci/releases/is-broken.js release.json > url.txt && echo IS_BROKEN=true >> $GITHUB_ENV || echo IS_BROKEN=false >> $GITHUB_ENV
echo "BROKEN_URL=$(cat url.txt)" >> $GITHUB_ENV
- name: Prepare AWS Session
if: env.IS_BROKEN == 'true'
shell: bash
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
path: repo
- name: Enable Developer Command Prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1.3.0
uses: ilammy/msvc-dev-cmd@v1.4.1
- name: Disable TCP/UDP Offloading (macOS)
if: runner.os == 'macOS'
shell: bash
Expand All @@ -49,12 +49,12 @@ jobs:
Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6
-UdpIPv6
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
- name: Setup conda
uses: s-weigand/setup-conda@v1
uses: s-weigand/setup-conda@v1.0.5
with:
update-conda: true
conda-channels: anaconda, conda-forge
Expand All @@ -75,10 +75,11 @@ jobs:
java-version: ${{ env.javaVersion }}
native-image: true
- name: Set Up SBT
shell: bash
run: |
curl -fsSL -o sbt.tgz https://github.com/sbt/sbt/releases/download/v${{env.sbtVersion}}/sbt-${{env.sbtVersion}}.tgz
tar -xzf sbt.tgz
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
echo $GITHUB_WORKSPACE/sbt/bin/ >> $GITHUB_PATH
# Caches
- name: Cache SBT
Expand All @@ -93,7 +94,8 @@ jobs:

# Bootstrap
- name: Enable Release Mode
run: echo ::set-env name=ENSO_RELEASE_MODE::true
shell: bash
run: echo "ENSO_RELEASE_MODE=true" >> $GITHUB_ENV
- name: Bootstrap the Project
working-directory: repo
run: |
Expand Down Expand Up @@ -145,15 +147,15 @@ jobs:
run: |
chmod +x enso
DIST_VERSION=$(./enso version --json --only-launcher | jq -r '.version')
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
- name: Prepare Distribution Version (Windows)
working-directory: repo
if: runner.os == 'Windows'
shell: bash
run: |
DIST_VERSION=$(./enso.exe version --json --only-launcher | jq -r '.version')
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
# Currently the only architecture supported by Github runners is amd64
- name: Prepare Distribution Environment
Expand All @@ -166,10 +168,10 @@ jobs:
LAUNCHER_DIST_DIR=$LAUNCHER_DIST_ROOT/enso
ENGINE_DIST_ROOT=enso-engine-$DIST_VERSION-$DIST_OS-$DIST_ARCH
ENGINE_DIST_DIR=$ENGINE_DIST_ROOT/enso-$DIST_VERSION
echo ::set-env name=LAUNCHER_DIST_DIR::$LAUNCHER_DIST_DIR
echo ::set-env name=LAUNCHER_DIST_ROOT::$LAUNCHER_DIST_ROOT
echo ::set-env name=ENGINE_DIST_DIR::$ENGINE_DIST_DIR
echo ::set-env name=ENGINE_DIST_ROOT::$ENGINE_DIST_ROOT
echo "LAUNCHER_DIST_DIR=$LAUNCHER_DIST_DIR" >> $GITHUB_ENV
echo "LAUNCHER_DIST_ROOT=$LAUNCHER_DIST_ROOT" >> $GITHUB_ENV
echo "ENGINE_DIST_DIR=$ENGINE_DIST_DIR" >> $GITHUB_ENV
echo "ENGINE_DIST_ROOT=$ENGINE_DIST_ROOT" >> $GITHUB_ENV
- name: Prepare Launcher Distribution (Common)
working-directory: repo
Expand Down Expand Up @@ -297,7 +299,7 @@ jobs:
ref=${{ github.ref }}
DIST_VERSION=${ref#"refs/tags/enso-"}
echo "Preparing release for $DIST_VERSION"
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
- name: Download GraalVM for Bundles
shell: bash
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

# Install Tooling
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
Expand All @@ -47,7 +47,7 @@ jobs:

# Lint
- name: Check Code
uses: actions-rs/cargo@v1
uses: actions-rs/cargo@v1.0.1
with:
command: check

Expand All @@ -64,7 +64,7 @@ jobs:

# Install Tooling
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
Expand All @@ -87,7 +87,7 @@ jobs:

# Lint
- name: Lint Code
uses: actions-rs/cargo@v1
uses: actions-rs/cargo@v1.0.1
with:
command: clippy

Expand All @@ -106,7 +106,7 @@ jobs:

# Install Tooling
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
Expand All @@ -127,7 +127,7 @@ jobs:

# Tests
- name: Test Native
uses: actions-rs/cargo@v1
uses: actions-rs/cargo@v1.0.1
with:
command: test

Expand All @@ -144,7 +144,7 @@ jobs:

# Install Tooling
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Enable Developer Command Prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1.3.0
uses: ilammy/msvc-dev-cmd@v1.4.1
- name: Disable TCP/UDP Offloading (macOS)
if: runner.os == 'macOS'
shell: bash
Expand All @@ -57,12 +57,12 @@ jobs:
Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6
-UdpIPv6
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ env.rustToolchain }}
override: true
- name: Setup conda
uses: s-weigand/setup-conda@v1
uses: s-weigand/setup-conda@v1.0.5
with:
update-conda: false
conda-channels: anaconda, conda-forge
Expand All @@ -83,10 +83,11 @@ jobs:
java-version: ${{ env.javaVersion }}
native-image: true
- name: Set Up SBT
shell: bash
run: |
curl --retry 4 --retry-connrefused -fsSL -o sbt.tgz https://github.com/sbt/sbt/releases/download/v${{env.sbtVersion}}/sbt-${{env.sbtVersion}}.tgz
tar -xzf sbt.tgz
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/
echo $GITHUB_WORKSPACE/sbt/bin/ >> $GITHUB_PATH
# Caches
- name: Cache SBT
Expand All @@ -112,22 +113,24 @@ jobs:
# Tests
- name: Setup Tests on Windows
if: runner.os == 'Windows'
shell: bash
run: |
echo '::set-env name=CI_TEST_TIMEFACTOR::2'
echo '::set-env name=CI_TEST_FLAKY_ENABLE::true'
echo "CI_TEST_TIMEFACTOR=2" >> $GITHUB_ENV
echo "CI_TEST_FLAKY_ENABLE=true" >> $GITHUB_ENV
- name: Build Base Java Extensions
shell: bash
run: |
sleep 1
sbt --no-colors std-bits/package
- name: Build the Launcher
shell: bash
run: |
sleep 1
sbt --no-colors launcher/buildNativeImage
# Prevents launcher/test from re-building the Native Image during
# test run. It is built before starting the tests to conserve system
# memory
echo '::set-env name=LAUNCHER_NATIVE_IMAGE_TEST_SKIP_BUILD::true'
echo "LAUNCHER_NATIVE_IMAGE_TEST_SKIP_BUILD=true" >> $GITHUB_ENV
- name: Test Enso
run: |
sleep 1
Expand Down Expand Up @@ -176,14 +179,14 @@ jobs:
shell: bash
run: |
DIST_VERSION=$(./enso version --json --only-launcher | jq -r '.version')
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
- name: Prepare Distribution Version (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
DIST_VERSION=$(./enso.exe version --json --only-launcher | jq -r '.version')
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo "DIST_VERSION=$DIST_VERSION" >> $GITHUB_ENV
# Currently the only architecture supported by Github runners is amd64
- name: Prepare Distribution Environment
Expand All @@ -195,10 +198,10 @@ jobs:
LAUNCHER_DIST_DIR=$LAUNCHER_DIST_ROOT/enso
ENGINE_DIST_ROOT=enso-engine-$DIST_VERSION-$DIST_OS-$DIST_ARCH
ENGINE_DIST_DIR=$ENGINE_DIST_ROOT/enso-$DIST_VERSION
echo ::set-env name=LAUNCHER_DIST_DIR::$LAUNCHER_DIST_DIR
echo ::set-env name=LAUNCHER_DIST_ROOT::$LAUNCHER_DIST_ROOT
echo ::set-env name=ENGINE_DIST_DIR::$ENGINE_DIST_DIR
echo ::set-env name=ENGINE_DIST_ROOT::$ENGINE_DIST_ROOT
echo "LAUNCHER_DIST_DIR=$LAUNCHER_DIST_DIR" >> $GITHUB_ENV
echo "LAUNCHER_DIST_ROOT=$LAUNCHER_DIST_ROOT" >> $GITHUB_ENV
echo "ENGINE_DIST_DIR=$ENGINE_DIST_DIR" >> $GITHUB_ENV
echo "ENGINE_DIST_ROOT=$ENGINE_DIST_ROOT" >> $GITHUB_ENV
- name: Prepare Launcher Distribution (Common)
shell: bash
Expand Down Expand Up @@ -259,7 +262,7 @@ jobs:
# Publish
- name: Publish the Engine Distribution Artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v2
with:
name: ${{ env.ENGINE_DIST_ROOT }}
path: ${{ env.ENGINE_DIST_ROOT }}
Expand All @@ -279,7 +282,7 @@ jobs:
zip -r -m -ll "fbs-upload/fbs-schema.zip" "fbs-upload/fbs-schema/"
- name: Publish the FlatBuffers Schemas
if: runner.os == 'Linux'
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v2
with:
name: Engine Protocol FlatBuffers Schemas
path: ./fbs-upload/fbs-schema.zip
Expand All @@ -290,7 +293,7 @@ jobs:
cp ./target/scala-parser.js parser-upload
- name: Publish the Parser JS Bundle
if: runner.os == 'Linux'
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v2
with:
name: Parser JS Bundle
path: ./target/scala-parser.js
Expand Down

0 comments on commit 0740905

Please sign in to comment.