Skip to content

Commit

Permalink
Build: Use Github Actions caching instead of SBT caching (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexklibisz committed Sep 25, 2022
1 parent 15f7734 commit b92b117
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 69 deletions.
76 changes: 41 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,39 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Debug
run: |
echo ${{ github.job }}
echo ${{ github.ref }}
echo ${{ github.ref_name }}
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
cache: 'sbt'
- uses: actions/cache@v3
with:
key: ci-${{ github.job }}-${{ github.ref_name }}
restore-keys: |
ci-${{ github.job }}-master
path: |
**/target/**/*
- name: Debug cache
run: |
find . -name target | xargs du -hs
find . -name succeeded_tests
- name: Misc. Setup
run: |
sudo snap install task --classic
sudo sysctl -w vm.max_map_count=262144
- name: Initialize SBT
run: sbt update
- name: Compile without Cache
- name: Compile
run: |
task jvm:clean
sbt compile Test/compile
task jvm:clean
- name: Pull Build Cache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sbt pullRemoteCache
- name: Compile with Cache
run: sbt compile Test/compile
sbt update compile Test/compile elasticsearchPluginBundle
- name: Run Cluster
run: task cluster:run
- name: Test
run: task jvm:test
- name: Push Build Cache
if: github.event_name == 'push'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sbt pushRemoteCache
run: sbt testQuick
- name: Cluster Logs
if: failure()
run: task cluster:logs
Expand All @@ -72,17 +71,20 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: '3.7.5'
cache: 'pip'
- uses: actions/cache@v3
with:
key: ci-${{ github.job }}-${{ github.ref_name }}
restore-keys: |
ci-${{ github.job }}-master
path: |
**/target/**/*
- name: Misc. Setup
run: |
sudo snap install task --classic
sudo sysctl -w vm.max_map_count=262144
- name: Docs
run: task py:docs
- name: Pull Build Cache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sbt pullRemoteCache
- name: Run Cluster
run: task cluster:run
- name: Test
Expand All @@ -105,6 +107,13 @@ jobs:
with:
python-version: '3.6'
cache: 'pip'
- uses: actions/cache@v3
with:
key: ci-${{ github.job }}-${{ github.ref_name }}
restore-keys: |
ci-${{ github.job }}-master
path: |
**/target/**/*
- name: Misc. Setup
run: |
sudo snap install task --classic
Expand All @@ -113,11 +122,6 @@ jobs:
run: task annb:submodule
- name: Install Dependencies
run: task annb:install
- name: Pull Build Cache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sbt pullRemoteCache
- name: Run Cluster
run: task cluster:run
- name: Test
Expand Down Expand Up @@ -163,18 +167,20 @@ jobs:
with:
python-version: '3.7.5'
cache: 'pip'
- uses: actions/cache@v3
with:
key: ci-${{ github.job }}-${{ github.ref_name }}
restore-keys: |
ci-${{ github.job }}-master
path: |
**/target/**/*
- run: |
sudo snap install task --classic
sudo snap install hub --classic
python3 -m pip install setuptools
- name: Publish to PyPi
run: task py:publish-snapshot VERSION=$(cat version)-dev${{ github.run_number }}
if: github.event_name == 'pull_request'
- name: Pull Build Cache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sbt pullRemoteCache
- name: Publish Plugin from PR
if: github.event_name == 'pull_request'
env:
Expand Down
3 changes: 2 additions & 1 deletion .sbtopts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-J-Xmx4096M
-J-Xms1024M
-J-Xms1024M
-J-XX:+UseG1GC
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.Response
import com.sksamuel.elastic4s.requests.searches.SearchResponse
import futil.Futil
import org.scalatest.DoNotDiscover
import org.scalatest.concurrent.AsyncCancelAfterFailure
import org.scalatest.funsuite.AsyncFunSuite
import org.scalatest.matchers.should.Matchers
Expand All @@ -25,6 +26,7 @@ import scala.util.hashing.MurmurHash3.orderedHash
* the same query, I have seen different results at times. This seems to be an effect at the Elasticsearch level.
* I've tested at the Lucene (sans ES) level and that seems to be reliably deterministic.
*/
@DoNotDiscover
class RecallSuite extends AsyncFunSuite with Matchers with ElasticAsyncClient with AsyncCancelAfterFailure {

// Each test case consists of setting up one Mapping and then running several queries against that mapping.
Expand Down
31 changes: 0 additions & 31 deletions project/BuildCachePlugin.scala

This file was deleted.

3 changes: 1 addition & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
addDependencyTreePlugin
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.21.0")

0 comments on commit b92b117

Please sign in to comment.