diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2a0b009..c562ffda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: branches: - - main + - FIXME pull_request: jobs: test: @@ -37,7 +37,7 @@ jobs: matrix: os: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: @@ -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 diff --git a/.github/workflows/community-build.yml b/.github/workflows/community-build.yml new file mode 100644 index 00000000..e1774e75 --- /dev/null +++ b/.github/workflows/community-build.yml @@ -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 + + +