Upgrade testcontainers up to 1.18.3 version. Fix GitHub actions: setu… #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UI | |
on: [push] | |
env: | |
JAVA_VERSION: '11' | |
jobs: | |
ui: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
nodejs-version: [12] | |
python-version: [3.8] | |
docker-version: [19.09] | |
docker-channel: [stable] | |
name: ui on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache python ${{ matrix.python-version }} deps | |
uses: actions/cache@v3 | |
with: | |
path: ~/.pip | |
key: ${{ runner.os }}-${{ matrix.os }}-pip- | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.os }}-pip- | |
- name: Install / upgrade pip | |
run: python -m pip install --upgrade pip setuptools | |
- name: Install HTTPie | |
run: pip install --upgrade httpie | |
- name: Setup Docker ${{ matrix.docker-channel }} ${{ matrix.docker-version }} | |
uses: docker-practice/actions-setup-docker@master | |
with: | |
docker_version: ${{ matrix.docker-version }} | |
docker_channel: ${{ matrix.docker-channel }} | |
- name: Cache docker ${{ matrix.docker-channel }} ${{ matrix.docker-version }} | |
uses: actions/cache@v3 | |
with: | |
path: ~/.docker | |
key: ${{ runner.os }}-${{ matrix.os }}-docker-${{ hashFiles('**/Dockerfile*') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.os }}-docker- | |
- name: Setup NodeJS ${{ matrix.nodejs-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.nodejs-version }} | |
- name: Cache npm ${{ matrix.nodejs-version }} deps | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-${{ matrix.os }}-npm- | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.os }}-npm- | |
- name: Install npm apps (wait-port) | |
run: npm install -g wait-port | |
- name: Setup java ${{ env.JAVA_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
# 'temurin' 'zulu' 'adopt' 'adopt-hotspot' 'adopt-openj9' 'liberica' 'microsoft' | |
distribution: 'temurin' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache maven deps ~/.m2/repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
${{ runner.os }}- | |
- name: Build maven apps | |
run: cd $GITHUB_WORKSPACE && ./mvnw -f ui clean package docker:build | |
- name: Run maven apps | |
run: cd $GITHUB_WORKSPACE && ./mvnw -f ui docker:start | |
- name: Test maven apps | |
run: | | |
wait-port 8080 | |
http :8080/ui/ | |
http :8080/ui/v1/api/names | |
http :8080/ui/v1/api/greeting | |
- name: Stop maven apps | |
run: cd $GITHUB_WORKSPACE && ./mvnw -f ui docker:stop docker:remove |