workflow test, init different workflows #4
Workflow file for this run
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: Run Tests | |
on: [push, pull_request, workflow_call] | |
jobs: | |
test_page_initiation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
token: ${{ secrets.CI_TOKEN }} | |
- name: Create certificates | |
run: | | |
openssl req -x509 -newkey rsa:4096 -nodes -out app/cert.pem -keyout app/key.pem -days 1 -subj "/C=PL/ST=State/L=/O=/OU=/CN=localhost" | |
- name: Build and run test web | |
run: | | |
IMAGE_NAME="zostaw/multiarch-home-page" | |
IMAGE_TAG="latest" | |
docker build -t $IMAGE_NAME:$IMAGE_TAG . | |
docker compose up -d | |
- name: Create docker network | |
run: | | |
docker network create my-network | |
docker network connect my-network home-page-home-page-1 | |
- name: Verify container | |
run: | | |
sleep 3 | |
docker ps | |
- name: Execute tests | |
run: | | |
sudo mkdir -m 777 $PWD/reports | |
docker run --network=my-network --shm-size=1g -e BROWSER=chrome -v ${PWD}/robot_tests:/opt/robotframework/tests:Z -v $PWD/reports:/opt/robotframework/reports:Z ppodgorsek/robot-framework:latest | |
- name: Upload test results | |
uses: actions/upload-artifact@v1 | |
if: always() | |
with: | |
name: reports | |
path: reports | |