Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Partition CI build by target platform
  • Loading branch information
ghostbuster91 committed Sep 23, 2023
commit 8f2d04ebc60c8c7f210a909579352ade8c61b28b
53 changes: 35 additions & 18 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,39 @@ name: CI

on:
push:
branches: [ "**" ]
tags: [ v* ]
branches: ["**"]
tags: [v*]
pull_request:
branches: [ "**" ]

branches: ["**"]
env:
# .sbtopts specifies 8g, which is needed to import into IntelliJ, but on GH that exceeds the maximum available memory
SBT_JAVA_OPTS: -J-Xms4g -J-Xmx4g
jobs:
build:
runs-on: ubuntu-20.04
env:
JAVA_OPTS: -Xmx4G
# run on external PRs, but not on internal PRs since those will be run by push to branch
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
scala-version: ["2.12", "2.13", "3"]
target-platform: ["JVM", "JS"]
steps:
- uses: actions/[email protected]
- uses: coursier/[email protected]
- uses: coursier/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
jvm: zulu:17
- name: Run tests with sbt
run: sbt test
distribution: "temurin"
cache: "sbt"
java-version: 11
- name: Compile
run: sbt $SBT_JAVA_OPTS -v "compileScoped ${{ matrix.scala-version }} ${{ matrix.target-platform }}"
- name: Compile docs
if: matrix.target-platform == 'JVM'
run: sbt compileDocs
- name: Test
run: sbt $SBT_JAVA_OPTS -v "testScoped ${{ matrix.scala-version }} ${{ matrix.target-platform }}"
- name: Generate LSIF
run: cs launch com.sourcegraph:scip-java_2.13:0.8.2 -- index
- name: Install sourcegraph/src
Expand All @@ -35,16 +48,22 @@ jobs:
name: Publish release
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
needs: [build]
runs-on: ubuntu-20.04
env:
JAVA_OPTS: -Xmx4G
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: coursier/[email protected]
- uses: olafurpg/setup-scala@v14
- run: sbt ci-release
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 11
cache: "sbt"
- name: Compile
run: sbt $SBT_JAVA_OPTS compile
- name: Publish artifacts
run: sbt $SBT_JAVA_OPTS ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand All @@ -66,5 +85,3 @@ jobs:
version: "v${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}