diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7d2f0318255cdfd9c6344df88fa633de31a01e8..25342af5790b1a45ab98c9e29a3dfb13bfe105fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,48 +2,83 @@ name: build-satella run-name: ${{ github.actor }} on: [ push ] jobs: - prepare-system: - runs-on: "ubuntu-latest" - strategy: - matrix: - python-version: [ "3.9" ] - steps: - - uses: actions/checkout@4 - - uses: actions/setup-python@4 - - name: Install everything - run: pip install -e .[test,dev,extras] - with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - paths: ["dist/*"] tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python-version: [ "3.6", "3.7", "3.8", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ] steps: - - uses: actions/checkout@4 - - uses: actions/setup-python@4 + - uses: actions/checkout@main + - uses: actions/setup-python@main with: - python-version: '${{ matrix.python-version }}' + python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install everything + run: | + sudo apt-get update + sudo apt-get install -y python3-setuptools python3-yaml + pip install -U pip setuptools wheel disttools packaging + pip install -U -e .[test,dev] - name: Test everything run: pytest -n 8 -vv --cov=satella + upload-coverage: + runs-on: "ubuntu-latest" + needs: ["tests"] + steps: + - uses: actions/setup-python@main with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - build-package: - needs: ["prepare-system"] - runs-on: ubuntu-latest + python-version: '3.10' + - run: coverage xml + - uses: caffco/code-climate-github-action@v1.0.0 + build-project: + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: [ "3.6.15", "3.7.1", "3.8.18", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ] steps: - - name: Build package + - uses: actions/setup-python@main + name: Setup Python + with: + python-version: '$${{ matrix.version }}' + cache: 'pip' + - name: Update system + run: | + sudo apt-get update + sudo apt-get install -y python3-setuptools python3-yaml + pip install -U pip setuptools wheel disttools packaging + - name: Alter Version + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + run: | + echo -e '__version__ = "' > satella/__init__.py + echo -e '${{ github.event.release.tag_name }}' >> satella/__init__.py + echo '"' >> satella/__init__.py + python -v + - name: Build run: python -m build . - - name: Store credentials + - name: Archive production artifacts + uses: actions/upload-artifact@master + with: + name: builds + path: | + dist + send-to-pypi: + runs-on: "ubuntu-latest" + needs: ["build-project", "tests"] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/setup-python@main + name: Setup Python + with: + python-version: '3.10' + cache: 'pip' + - name: Install Twine + run: pip install twine + - name: Download all builds artifacts + uses: actions/download-artifact@main + with: + name: builds + - name: Send over packages to PyPI run: | echo $PYPIRC_PASSWORD_DATA > ~/.pypirc twine upload dist/* - convert-and-upload-coverage: - needs: ["build-package", "tests"] - steps: - - run: coverage xml - - uses: caffco/code-climate-github-action@v1.0.0 + diff --git a/README.md b/README.md index bf5ef7e04e05c1dae827f8f867244372837d422a..49b81e781b889b3494fe60bcc04cba72efed5b41 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ satella ======== -[](https://app.circleci.com/pipelines/github/piotrmaslanka/satella) -[](https://codeclimate.com/github/piotrmaslanka/satella/test_coverage) +[](https://codeclimate.com/github/piotrmaslanka/satella/test_coverage) [](https://codeclimate.com/github/piotrmaslanka/satella) [](https://codeclimate.com/github/piotrmaslanka/satella) [](https://pypi.python.org/pypi/satella) @@ -56,6 +55,13 @@ pip install satella[extras] Running unit tests ------------------ -Tests run by default on CircleCI. +Tests run by default on GitHub Actions. They should pass on Windows too, but some tests requiring POSIX-like functionality are skipped. + +Automatic release system +------------------------ + +Releases happen automatically. Just add a tag with the name of the version. + +**NOTE that changes from 2.25 will be numbered as tags without the prefix ```v```**! \ No newline at end of file