Skip to content

Commit

Permalink
Multiple CI updates:
Browse files Browse the repository at this point in the history
- Add matrix to test different Java versions
- Cleaned up the CI workflow file a bit.
  - The steps were too compacted, believe new layout makes it easier to read and follow.
- Add java_version to job names.
- Remove sbt compile from windows jobs, seemed to cause windows issues.

Closes #772
  • Loading branch information
shanedell committed Nov 29, 2023
1 parent 07720b1 commit 9f5a194
Showing 1 changed file with 94 additions and 31 deletions.
125 changes: 94 additions & 31 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,54 +42,96 @@ jobs:
code-format:
name: TypeScript/Scala/Svelte Formatting
runs-on: ubuntu-20.04
strategy:
matrix:
java_distribution: [ temurin ]
java_version: [ 8 ]
os: [ ubuntu-20.04 ]
node: [ '16' ]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++2.12.15
steps:
- uses: actions/[email protected]
- name: Setup Node 16
uses: actions/[email protected]
with:
node-version: '16'
- name: Setup Java 8
############################################################
# Setup
############################################################

- name: Check out Repository
uses: actions/[email protected]

- name: Setup Java
uses: actions/[email protected]
with:
distribution: temurin
java-version: 8
- run: $SBT scalafmtCheck
- run: $SBT scalafmtSbtCheck
- run: yarn install
- run: yarn lint
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}

- name: Install Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}

############################################################
# Lint/format checks
############################################################

- name: Scala format check
run: $SBT scalafmtCheck

- name: Scala sbt format check
run: $SBT scalafmtSbtCheck

- name: Install node dependencies
run: yarn install

- name: TypeScript lint
run: yarn lint

rat-check:
name: Rat Check
runs-on: ubuntu-20.04
strategy:
matrix:
java_distribution: [ temurin ]
java_version: [ 8 ]
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++2.12.15
steps:
- name: Setup Java 8
uses: actions/[email protected]
with:
distribution: temurin
java-version: 8
############################################################
# Setup
############################################################

- name: Check out Repository
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Setup Java
uses: actions/[email protected]
with:
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}

############################################################
# Rat check
############################################################

- name: Run Rat Check
run: $SBT ratCheck || (cat target/rat.txt; exit 1)

build-test-package:
name: 'Build, Test, and Package (OS: ${{ matrix.os }}, Node: ${{ matrix.node }})'
name: 'Build, Test, and Package (OS: ${{ matrix.os }}, Node: ${{ matrix.node }}, Java: ${{ matrix.java_version }})'
strategy:
matrix:
os: [macos-11, ubuntu-20.04, windows-2019]
java_distribution: [ temurin ]
java_version: [ 8, 11, 17 ]
os: [ macos-11, ubuntu-20.04, windows-2019 ]
node: [ '16', '18' ]
fail-fast: false # don't immediately fail all other jobs if a single job fails
runs-on: ${{ matrix.os }}
Expand All @@ -99,25 +141,46 @@ jobs:
env:
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++2.12.15
steps:
- name: Setup Java 8
############################################################
# Setup
############################################################

- name: Check out Repository
uses: actions/[email protected]

- name: Setup Java
uses: actions/[email protected]
with:
distribution: temurin
java-version: 8
- uses: actions/[email protected]
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}

- name: Install Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node}}
- run: $SBT compile # used to initialize sbt, if not done sbt universal:packageBin ran by yarn package times out -- windows only
if: runner.os == 'Windows'
- run: yarn install
- run: xvfb-run -a yarn test
node-version: ${{ matrix.node }}

############################################################
# Build & Package
############################################################

# - name: Compile Scala
# run: $SBT compile # used to initialize sbt, if not done sbt universal:packageBin ran by yarn package times out -- windows only
# if: runner.os == 'Windows'

- name: Install node dependencies
run: yarn install

- name: Runs tests - Linux
run: xvfb-run -a yarn test
if: runner.os == 'Linux'
- run: yarn test

- name: Runs tests - Windows/Mac
run: yarn test
if: runner.os != 'Linux'

- name: Check for Errors in macOS
run: tail -n 1000 '/Users/runner/Library/Application Support/omega_edit/'* && exit 1
if: failure() && runner.os == 'macOS'

- name: Package
run: yarn package

0 comments on commit 9f5a194

Please sign in to comment.