{"id":18732686,"url":"https://github.com/pavelzw/pytest-action","last_synced_at":"2025-04-12T18:31:17.034Z","repository":{"id":41315898,"uuid":"496978345","full_name":"pavelzw/pytest-action","owner":"pavelzw","description":":octocat: GitHub Action to run pytest with GitHub Job Summaries support :snake: :rocket:","archived":false,"fork":false,"pushed_at":"2024-03-18T15:36:49.000Z","size":200,"stargazers_count":27,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T15:52:09.696Z","etag":null,"topics":["actions","job-summaries","pytest","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavelzw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-27T11:54:16.000Z","updated_at":"2025-02-12T18:37:35.000Z","dependencies_parsed_at":"2024-01-02T14:43:03.658Z","dependency_job_id":"fee4a47a-a226-449e-b3a7-cb82ff4a79b3","html_url":"https://github.com/pavelzw/pytest-action","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":0.4,"last_synced_commit":"9c63b24d32fb9d10f98b91b5058bc0256a32bd1d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelzw%2Fpytest-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelzw%2Fpytest-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelzw%2Fpytest-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelzw%2Fpytest-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavelzw","download_url":"https://codeload.github.com/pavelzw/pytest-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613345,"owners_count":21133496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","job-summaries","pytest","python"],"created_at":"2024-11-07T15:07:18.591Z","updated_at":"2025-04-12T18:31:16.623Z","avatar_url":"https://github.com/pavelzw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action for pytest\n\nThis GitHub Action allows you to run `pytest` and output [GitHub Job Summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/). For creating the job summaries, this action uses [`pytest-md`](https://github.com/hackebrot/pytest-md) and [`pytest-emoji`](https://github.com/hackebrot/pytest-emoji).\n\n```yml\n- name: Run pytest\n  uses: pavelzw/pytest-action@v2\n  with:\n    verbose: true\n    emoji: true\n    job-summary: true\n    custom-arguments: '-q'\n    click-to-expand: true\n    report-title: 'Test Report'\n```\n\nYou need to have Python as well as `pytest` installed in your pipeline before you can run this action. If `job-summary` is set to `true`, you also need to install `pytest-md`. If `emoji` is set to `true`, you need to install `pytest-emoji`.\n\nWhen `job-summary` is set to `true`, the action will output a Job Summary.\n\n![Example Job Summary](./.github/assets/summary-example-light.png#gh-light-mode-only)\n![Example Job Summary](./.github/assets/summary-example-dark.png#gh-dark-mode-only)\n\n\u003c!-- action-docs-inputs --\u003e\n## Inputs\n\n| parameter | description | required | default |\n| --- | --- | --- | --- |\n| job-summary | Print a GitHub job summary | `false` | true |\n| verbose | Verbose output | `false` | true |\n| emoji | Use emojis in the output | `false` | true |\n| custom-arguments | Custom arguments to pass to pytest | `false` |  |\n| custom-pytest | Custom command to replace the `pytest` call. Can be a custom executable or something like `poetry run pytest` or `micromamba run -n myenv pytest`. | `false` | pytest |\n| report-title | Title of the report | `false` | Test Report |\n| click-to-expand | Add 'Click to expand' to the report | `false` | true |\n\u003c!-- action-docs-inputs --\u003e\n\n## Setting time zone\n\nIf you want to change the time zone of the job summary, you may want to use the [szenius/set-timezone](https://github.com/marketplace/actions/set-timezone) action:\n```yml\n- name: Set timezone\n  uses: szenius/set-timezone@v1.2\n  with:\n    timezone: 'Europe/Berlin'\n```\n\n## Activating `conda` environments\n\nThis action uses `bash -l {0}` as the shell to run `pytest` in, \ni.e., the login shell that also sources your `.bash_profile`. \nWhen using `bash` in GitHub Actions, it doesn't source your `.bash_profile` by default. \nIf you want to use a `conda` environment, you need to make sure to add it into your `.bash_profile` s.t. \nthe `conda` environment automatically gets activated. \n[mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) \ndoes this automatically for you.\n\n```yml\n- uses: mamba-org/setup-micromamba@v1\n  with:\n    environment-name: myenv\n    create-args: \u003e-\n      python=3.11\n      pytest\n      numpy\n      pytest-md\n      pytest-emoji\n- uses: pavelzw/pytest-action@v2\n```\n\n## Example Usage\n\n```yml\nname: Run Python tests\n\non: [push]\n\njobs:\n  build:\n    name: Run tests\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        python-version: [\"3.6\", \"3.7\", \"3.8\", \"3.9\"]\n\n    steps:\n      - uses: szenius/set-timezone@v1.2\n        with:\n          timezoneLinux: \"Europe/Berlin\"\n      - uses: actions/checkout@v3\n      - name: Set up Python ${{ matrix.python-version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python-version }}\n      - name: Install dependencies\n        run: pip install pytest pytest-md pytest-emoji\n      - uses: pavelzw/pytest-action@v2\n        with:\n          emoji: false\n          verbose: false\n          job-summary: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelzw%2Fpytest-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavelzw%2Fpytest-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelzw%2Fpytest-action/lists"}