Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New community build workflow #765

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
30 changes: 10 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- main
- FIXME
pull_request:
jobs:
test:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
Expand All @@ -48,25 +48,15 @@ jobs:
- uses: sbt/setup-sbt@v1

- name: Build Dockerised CLI
run: sbt cli/docker

- name: Test repos
shell: bash
run: |
set -eu
check_repo() {
REPO=$1
mkdir -p .repos/$REPO
git clone https://github.com/$REPO.git .repos/$REPO && cd .repos/$REPO && git submodule update --init
run: sbt cli/docker

docker run -v $PWD/.repos/$REPO:/sources -w /sources sourcegraph/scip-java:latest scip-java index
file .repos/$REPO/index.scip || (echo "$REPO SCIP index doesn't exist!"; exit 1)
}

sudo apt install parallel
export -f check_repo

parallel -j4 check_repo ::: circe/circe indeedeng/iwf-java-sdk
- uses: actions/checkout@v3
with:
path: sources
repository: spring-projects/spring-boot

- run: |
docker run -v $PWD/sources:/sources -w /sources sourcegraph/scip-java:latest-snapshot scip-java index

bazel:
runs-on: ubuntu-latest
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/community-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Community build
on:
push:
branches: [main]
tags: ["*"]
pull_request:
workflow_dispatch:
inputs:
scipJavaVersion:
description: 'Version of scip-java to run (if empty, main branch will be republished)'
required: false
default: ''
type: string
runGroup:
description: 'Which set of repos to run (quick runs a small number of small repos, full runs all)'
required: false
default: quick
type: choice
options:
- quick
- full


jobs:
build_from_source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'sbt'

- uses: sbt/setup-sbt@v1

- run: sbt cli/pack

- run: |
cd scip-java/target/pack && zip -r ../../../scip-java.zip .

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: scip-java.zip
name: scip-java-binary
if-no-files-found: error


community_build:
runs-on: ubuntu-latest
needs: [build_from_source]
strategy:
fail-fast: true
matrix:
include:
- repo: spring-projects/spring-data-relational
jdk: 17
group: quick

- repo: spring-projects/spring-framework
jdk: 17
group: full

- repo: spring-projects/spring-boot
jdk: 17
group: full
steps:
- name: Download binaries
uses: actions/download-artifact@v4
id: scip-java-binary
if: ${{ inputs.runGroup == matrix.group }}
with:
path: binaries

- name: Unpack scip-java build
if: ${{ inputs.runGroup == matrix.group }}
run: |
unzip binaries/scip-java-binary/scip-java.zip -d scip-java

- uses: actions/checkout@v3
if: ${{ inputs.runGroup == matrix.group }}
with:
repository: ${{ matrix.repo }}
path: sources

- uses: actions/setup-java@v3
if: ${{ inputs.runGroup == matrix.group }}
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}

- run: ../scip-java/bin/scip-java index
if: ${{ inputs.runGroup == matrix.group }}
working-directory: sources



Loading