Integration #2
Workflow file for this run
This file contains hidden or 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 API & Selenium Tests Separately | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| api-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Install Docker Compose | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y docker-compose | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Pull Latest Test Image | |
| run: docker pull moslemasaad/gitea-test-automation | |
| - name: Run API Tests | |
| run: | | |
| cd Gitea-Test-Automation | |
| docker-compose up --exit-code-from api-test-runner api-test-runner | |
| - name: Stop API Containers | |
| run: | | |
| cd Gitea-Test-Automation | |
| docker-compose down | |
| selenium-tests: | |
| runs-on: ubuntu-latest | |
| needs: api-tests | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Install Docker Compose | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y docker-compose | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Pull Latest Test Image | |
| run: docker pull moslemasaad/gitea-test-automation | |
| - name: Start Selenium Grid & Run Selenium Tests | |
| run: | | |
| cd Gitea-Test-Automation | |
| docker-compose up --exit-code-from selenium-test-runner selenium-hub chrome-node firefox-node selenium-test-runner | |
| - name: Stop Selenium Containers | |
| run: | | |
| cd Gitea-Test-Automation | |
| docker-compose down |