Skip to content

update README.md

update README.md #52

Workflow file for this run

name: Run sbt tests using couchbase service container
on:
push:
schedule:
- cron: "0 11 * * 0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update repositories
run: |
apt update || echo "apt-update failed" # && apt -y upgrade
- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: Setup couchbase
run: |
apt install -y iputils-ping || echo "apt-install failed"
ping -c 1 couchbase && (
apt install -y socat
socat TCP-LISTEN:8091,fork TCP:couchbase:8091 &
socat TCP-LISTEN:8092,fork TCP:couchbase:8092 &
socat TCP-LISTEN:8093,fork TCP:couchbase:8093 &
socat TCP-LISTEN:8094,fork TCP:couchbase:8094 &
socat TCP-LISTEN:8095,fork TCP:couchbase:8095 &
socat TCP-LISTEN:8096,fork TCP:couchbase:8096 &
socat TCP-LISTEN:9140,fork TCP:couchbase:9140 &
socat TCP-LISTEN:11210,fork TCP:couchbase:11210 &
socat TCP-LISTEN:11211,fork TCP:couchbase:11211 &
socat TCP-LISTEN:11207,fork TCP:couchbase:11207 &
socat TCP-LISTEN:18091,fork TCP:couchbase:18091 &
socat TCP-LISTEN:18092,fork TCP:couchbase:18092 &
socat TCP-LISTEN:18093,fork TCP:couchbase:18093 &
socat TCP-LISTEN:18094,fork TCP:couchbase:18094 &
socat TCP-LISTEN:18095,fork TCP:couchbase:18095 &
socat TCP-LISTEN:18096,fork TCP:couchbase:18096 &
) && echo "Initialized couchbase port forwarding" || echo "ping couchbase failed, not forwarding ports"
printf "Waiting for CB startup..."
wget -O /dev/null http://localhost:8091/ && echo "DONE" || (echo "FAIL" && panic)
curl -v -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex'
curl -v -X POST http://localhost:8091/pools/default -d 'memoryQuota=256' -d 'indexMemoryQuota=256'
curl -u Administrator:password -v -X POST http://localhost:8091/settings/web -d 'password=password&username=Administrator&port=SAME'
curl -v -X POST http://localhost:8091/pools/default/buckets \
-u Administrator:password \
-d name=travel-sample \
-d bucketType=couchbase\
-d ramQuotaMB=1024 \
-d durabilityMinLevel=majorityAndPersistActive
curl -u Administrator:password -v -X POST http://localhost:8091/settings/indexes -d 'storageMode=memory_optimized'
curl -u Administrator:password -v -X GET http://localhost:8091/pools/default | jq '.' | grep hostname
- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
# - name: Check that workflows are up to date
# run: sbt ++${{ matrix.scala }} githubWorkflowCheck
- name: Build project
run: sbt ++${{ matrix.scala }} test
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure,warnings'
notification_title: 'Repo: *{repo}*'
message_format: '{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>'
footer: '<{run_url}|View Full Run on GitHub>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
services:
couchbase:
image: public.ecr.aws/z2f7n8a1/couchbase-da-containers:couchbase-neo
options: >-
--health-cmd "wget -q -O - localhost:8091"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 8095:8095
- 8096:8096
- 9140:9140
- 11210:11210
- 11211:11211
- 11207:11207
- 18091:18091
- 18092:18092
- 18093:18093
- 18094:18094
- 18095:18095
- 18096:18096