ci: PLT-478: Replace FM with actions-hub call (#154) #536
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: tests | |
on: | |
push: | |
branches: | |
- master | |
- 'release/**' | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
branches: | |
- master | |
- 'release/**' | |
jobs: | |
run_pytest: | |
name: Run pytest for Evalme | |
runs-on: ubuntu-latest | |
env: | |
LOG_DIR: pytest_logs | |
collect_analytics: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.7' | |
- uses: actions/cache@v4 | |
name: Configure pip cache | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
sudo apt-get clean | |
sudo apt-get update | |
sudo apt-get install virtualenv libsasl2-dev python3-dev libldap2-dev libssl-dev | |
pip install -U pip==20.2 | |
pip install -r requirements.txt -r requirements-test.txt | |
- name: Run functional tests | |
run: | | |
cd evalme/ | |
pytest --junitxml report.xml --cov=. -m "not integration_tests" | |
- name: "Upload coverage to Codecov" | |
uses: codecov/[email protected] | |
with: | |
name: codecov | |
files: ./evalme/report.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
dependabot-auto-merge: | |
name: "Auto Merge dependabot PR" | |
if: | | |
always() && | |
needs.run_pytest.result == 'success' && | |
github.event_name == 'pull_request' && | |
github.event.pull_request.user.login == 'dependabot[bot]' && | |
( startsWith(github.head_ref, 'dependabot/npm_and_yarn/') || startsWith(github.head_ref, 'dependabot/pip/') ) | |
runs-on: ubuntu-latest | |
needs: | |
- run_pytest | |
steps: | |
- name: Enable auto-merge for Dependabot PRs | |
run: gh pr merge --admin --squash "${PR_URL}" | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{ secrets.GIT_PAT }} |