Merge pull request #272 from jadolg/dependabot/github_actions/codecov… #631
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: Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * 5' | |
jobs: | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install black | |
run: pip install black | |
- name: Lint with black | |
run: black --check --diff . | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
rocket-chat-version: [ '6.8.7','6.9.7','6.10.6','6.11.3','6.12.2', '6.13.0', '7.0.0', 'latest' ] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Start rocket.chat server | |
uses: isbang/[email protected] | |
with: | |
compose-file: docker-compose.yml | |
env: | |
ROCKETCHAT_LICENSE: ${{ secrets.ROCKETCHAT_LICENSE }} | |
ROCKET_CHAT_VERSION: ${{ matrix.rocket-chat-version }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install pytest-cov requests | |
- name: Wait for rocket.chat server to be online | |
run: until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done; | |
timeout-minutes: 5 | |
- name: Run tests | |
run: pytest tests rocketchat_API -x --cov-report xml --cov=./ | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
verbose: true | |
files: coverage.xml | |
fail_ci_if_error: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |