diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d08f3af..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,182 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -# TODO: port to github actions -version: 2 - -jobs: - "python-3.7": - docker: - - image: cimg/python:3.7 - - working_directory: ~/repo - - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-py3.7-{{ checksum "test-requirements.txt" }} - - v2-dependencies-py3.7- - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r test-requirements.txt - - save_cache: - paths: - - ./venv - key: v2-dependencies-py3.7-{{ checksum "test-requirements.txt" }} - - run: - name: run tests - command: | - . venv/bin/activate - make test - - run: - name: run lint - command: | - . venv/bin/activate - make lint - - "python-3.7_trio-0.11": - docker: - - image: cimg/python:3.7 - - working_directory: ~/repo - - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-py3.7-{{ checksum "test-requirements_trio-0.11.txt" }} - - v2-dependencies-py3.7- - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r test-requirements.txt - - save_cache: - paths: - - ./venv - key: v2-dependencies-py3.7-{{ checksum "test-requirements_trio-0.11.txt" }} - - run: - name: run tests - command: | - . venv/bin/activate - make test - - run: - name: run lint - command: | - . venv/bin/activate - make lint - - "python-3.8": - docker: - - image: cimg/python:3.8 - - working_directory: ~/repo - - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-py3.8-{{ checksum "test-requirements.txt" }} - - v2-dependencies-py3.8- - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r test-requirements.txt - - save_cache: - paths: - - ./venv - key: v2-dependencies-py3.8-{{ checksum "test-requirements.txt" }} - - run: - name: run tests - command: | - . venv/bin/activate - make test - - run: - name: run lint - command: | - . venv/bin/activate - make lint - - "python-3.9": - docker: - - image: cimg/python:3.9 - - working_directory: ~/repo - - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-py3.9-{{ checksum "test-requirements.txt" }} - - v2-dependencies-py3.9- - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r test-requirements.txt - - save_cache: - paths: - - ./venv - key: v2-dependencies-py3.9-{{ checksum "test-requirements.txt" }} - - run: - name: run tests - command: | - . venv/bin/activate - make test - - run: - name: run lint - command: | - . venv/bin/activate - make lint - - "python-3.10": - docker: - - image: cimg/python:3.10 - - working_directory: ~/repo - - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-py3.10-{{ checksum "test-requirements.txt" }} - - v2-dependencies-py3.10- - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r test-requirements.txt - - save_cache: - paths: - - ./venv - key: v2-dependencies-py3.10-{{ checksum "test-requirements.txt" }} - - run: - name: run tests - command: | - . venv/bin/activate - make test - - run: - name: run lint - command: | - . venv/bin/activate - make lint - -workflows: - version: 2 - build: - jobs: - - "python-3.7" - - "python-3.7_trio-0.11" - - "python-3.8" - - "python-3.9" - - "python-3.10" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4feedc0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: [push] + +jobs: + build_and_test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + requirements: [test-requirements.txt] + include: + - python-version: '3.7' + requirements: test-requirements_trio-0.11.txt + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: ${{ matrix.requirements }} + # TODO: unpinned "latest" build + - run: pip install . -r ${{ matrix.requirements }} + - run: make test lint diff --git a/README.md b/README.md index 93ba993..92310eb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://img.shields.io/circleci/build/github/belm0/perf-timer)](https://circleci.com/gh/belm0/perf-timer) +[![Build status](https://img.shields.io/github/workflow/status/belm0/perf-timer/CI)](https://github.com/belm0/perf-timer/actions/workflows/ci.yml) [![Package version](https://img.shields.io/pypi/v/perf-timer.svg)](https://pypi.org/project/perf-timer) [![Supported Python versions](https://img.shields.io/pypi/pyversions/perf-timer.svg)](https://pypi.org/project/perf-timer)