mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
aider: Added GitHub Actions workflow for running Python tests on push and pull request to the main branch.
# Context: USER: how can i run my tests in ci on github? ASSISTANT: To run your tests in a CI environment on GitHub, you can use GitHub Actions. Here's a step-by-step guide to set up a basic Python testing workflow: 1. Create a new directory named `.github` in the root of your repository if it doesn't exist. 2. Inside the `.github` directory, create another directory named `workflows`. 3. Create a new file named `python-tests.yml` inside the `workflows` directory. Now, add the following content to the `python-tests.yml` file: ```yaml .github/workflows/python-tests.yml <<<<<<< ORIGINAL ======= name: Python Tests on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] steps: - name: Check out repository uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run tests run: | python -m unittest discover >>>>>>> UPDATED ``` This workflow will run your tests on every push and pull request to the `main` branch using Python versions 3.6, 3.7, 3.8, and 3.9. After you've added the `python-tests.yml` file to your repository, GitHub Actions will automatically start running your tests according to the specified workflow.
This commit is contained in:
parent
76c964bade
commit
203b37a051
1 changed files with 34 additions and 0 deletions
34
.github/workflows/python-tests.yml
vendored
Normal file
34
.github/workflows/python-tests.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Python Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
python -m unittest discover
|
Loading…
Add table
Add a link
Reference in a new issue