Develop kb #58
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 Robot Framework Tests | |
# This workflow gets triggered on pushes and pull requests to the master branch. | |
# Tests are not run at changes on the README file. | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'README.md' | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
run_tests: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout code from the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Sets up the specified Python version | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
# Install Poetry for dependency management | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
# Cache dependencies for faster subsequent runs | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
# Specify the cache directory | |
path: ~/.cache/pypoetry | |
# Use a unique key for the cache based on the OS and the content of pyproject.toml | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} | |
# Specify keys to restore cache if the exact key is not found | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
# Install project dependencies using Poetry | |
- name: Install dependencies | |
run: poetry install | |
# Add LEDSA to PYTHONPATH | |
- name: Add LEDSA to PYTHONPATH | |
run: echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
# create folder for test reports | |
- name: Create folder for reports | |
run: mkdir reports | |
# run Robot Framework tests | |
- name: Run Robot Framework Tests | |
run: | | |
robot \ | |
--outputdir reports \ | |
ledsa/tests/AcceptanceTests | |
# If the tests fail, this step ensures the logs are uploaded for inspection | |
- name: Upload Robot Framework logs | |
# This condition ensures the step runs regardless of the test outcome | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: robot-framework-logs | |
path: results/ |