diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..395e19b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + LOG_DIR: ${{github.workspace}}/log + BIN_DIR: ${{github.workspace}}/bin + COMPOSE_LOG: ${{github.workspace}}/log/docker-compose.log + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + matrix: + docker-compose: + - 'containers/docker-compose.yml' + - 'containers/es7/docker-compose.yml' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cache project dependencies + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-clojure-${{ hashFiles('**/project.clj') }} + restore-keys: | + ${{ runner.os }}-clojure + - name: Prepare java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + # ES5 needs this + - run: sudo sysctl -w vm.max_map_count=262144 + # create log & bin dir if missing + - run: mkdir -p $LOG_DIR + - run: mkdir -p $BIN_DIR + - run: docker compose -f ${{ matrix.docker-compose }} up -d --wait + - run: docker compose -f ${{ matrix.docker-compose }} logs -f > $COMPOSE_LOG & + - run: docker compose -f ${{ matrix.docker-compose }} ps + + # Wait ES + - run: until curl http://127.0.0.1:9207/; do sleep 1; done + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@12.5 + with: + lein: latest + - run: lein do clean, javac, test :all, with-profile test-encoding test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cc09b6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: clojure -lein: 2.9.1 -dist: trusty -script: lein do clean, javac, test :all, with-profile test-encoding test - - -# Cache our Maven deps to be kind to clojars, github, docker images -cache: - directories: - - $HOME/bin - - $HOME/.m2 -jdk: - - oraclejdk8 - - openjdk11 - -before_install: - # ES5 needs this - - sudo sysctl -w vm.max_map_count=262144 - # create log & bin dir if missing - - mkdir -p $LOG_DIR - - mkdir -p $BIN_DIR - - #https://github.com/travis-ci/travis-ci/issues/5227 - - echo "127.0.0.1 "`hostname` | sudo tee /etc/hosts - - # install docker-compose if not in cache - - if [ ! -f $COMPOSE_BIN ]; then curl -L {$COMPOSE_URI}/docker-compose-`uname -s`-`uname -m` > $COMPOSE_BIN; fi - - chmod +x $COMPOSE_BIN - -before_script: - - $COMPOSE_BIN -f containers/docker-compose.yml up -d > $COMPOSE_LOG - # Wait ES - - until curl http://127.0.0.1:9207/; do sleep 1; done - -services: - - docker - -env: - global: - - LOG_DIR=$HOME/log - - BIN_DIR=$HOME/bin - - COMPOSE_URI=https://github.com/docker/compose/releases/download/1.25.3 - - COMPOSE_BIN=$HOME/bin/docker-compose-1-25-3 - - COMPOSE_LOG=$HOME/log/docker-compose.log diff --git a/containers/docker-compose.yml b/containers/docker-compose.yml index 75112a3..d0c3ce1 100644 --- a/containers/docker-compose.yml +++ b/containers/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: es7: image: elasticsearch:7.10.1 diff --git a/containers/es7/docker-compose.yml b/containers/es7/docker-compose.yml index cbc7457..fa74898 100644 --- a/containers/es7/docker-compose.yml +++ b/containers/es7/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: elasticsearch-dev: image: elasticsearch:7.10.1