Skip to content

Update README.md file. #280

Update README.md file.

Update README.md file. #280

name: 'integration tests'
on:
push:
jobs:
integration-tests:
name: java-${{ matrix.java }} integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 21, 22]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
# 'temurin' 'zulu' 'adopt' 'adopt-hotspot' 'adopt-openj9' 'liberica' 'microsoft'
distribution: 'corretto'
java-version: ${{ matrix.java }}
- uses: actions/cache@v4
with:
path: |
~/.m2
~/.docker
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- run: sudo apt install -yq httpie jq
- run: command -v docker >/dev/null 2>&1 || { echo >&2 "Docker is required but not installed. Aborting."; exit 1; }
- run: command -v http >/dev/null 2>&1 || { echo >&2 "HTTPie is required but not installed. Aborting."; exit 1; }
- run: command -v jq >/dev/null 2>&1 || { echo >&2 "jq is required but not installed. Aborting."; exit 1; }
- run: sudo rm -rfv ~/.m2/repository/io/github/daggerok
- run: cd $GITHUB_WORKSPACE ; ./mvnw clean ; ./mvnw install -DskipTests
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f docker docker:start
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f distributed-lock-mongodb-spring-boot-starter-example spring-boot:start
- run: http -I get :8080/get-state/daggerok
- run: http -I post :8080/post-state/daggerok/initialize-state
- run: |
export id=`http -I post :8080/post-lock/daggerok | jq -r '.id'` ;
echo "Captured id: ${id}" ;
http -I post :8080/post-state/daggerok/this-should-not-work ;
http -I post :8080/post-unlock-by-id/${id} ;
- run: http -I post :8080/post-state/daggerok/but-now-this-should-work
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f distributed-lock-mongodb-spring-boot-starter-example spring-boot:stop
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f docker docker:stop