This repository has been archived by the owner on Mar 30, 2024. It is now read-only.
Docker compose localhost (#22) #63
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: selenium | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
docker: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
# https://github.com/actions/setup-java#supported-distributions | |
distribution: 'microsoft' | |
java-version: 11 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Start containers | |
run: | | |
cd docker-compose | |
docker-compose -f svjis-dev.yml up -d | |
- name: Create schema | |
run: | | |
cd docker-compose | |
curl -k -L -o ./database.sql -L https://raw.githubusercontent.com/svjis/svjis/master/db_schema/database.sql | |
docker cp ./database.sql svjis_db:/firebird/ | |
docker cp ./create-schema.sh svjis_db:/firebird/ | |
docker exec svjis_db bash "/firebird/create-schema.sh" | |
- name: Test of docker-compose | |
run: | | |
string="New Company" | |
if curl -s "http://localhost:8080" | grep -q "$string"; then | |
echo "'$string' found" | |
else | |
curl "http://localhost:8080" | |
echo "'$string' not found" | |
exit 1 | |
fi | |
- name: Install Google Chrome | |
run: | | |
npx @puppeteer/browsers install chrome@stable | |
google-chrome --version | |
- name: Run selenium test | |
run: | | |
git clone https://github.com/svjis/svjis-selenium.git | |
cd svjis-selenium | |
mvn test --no-transfer-progress | |
- name: Archive screen shots | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Screenshots | |
path: svjis-selenium/target/*.png | |
- name: Stop containers | |
if: always() | |
run: | | |
cd docker-compose | |
docker-compose -f svjis-dev.yml down |