name: CI on: push: tags: ["*.*.*"] branches: [master] pull_request: branches: [master] schedule: - cron: 37 1 * * 1 jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.x - uses: pre-commit/action@v3.0.0 lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.x - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - run: make install - run: make lint test: runs-on: ubuntu-20.04 strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - run: make install - run: make test e2e: runs-on: ubuntu-latest strategy: fail-fast: false matrix: zabbix-version: ["4.0", "5.0", "6.0", "6.4"] env: ZABBIX_VERSION: ${{ matrix.zabbix-version }} steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.x - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - run: docker-compose up -d - run: docker-compose images - run: make install - run: make e2e publish: if: startsWith(github.ref, 'refs/tags') needs: [pre-commit, lint, test, e2e] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.x - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - run: make clean build - if: github.repository_owner == 'lukecyca' uses: pypa/gh-action-pypi-publish@v1.5.0 with: password: ${{ secrets.PYPI_API_TOKEN }} - if: github.repository_owner == 'lukecyca' uses: softprops/action-gh-release@v1 with: draft: true body: | Please see [CHANGELOG.md](https://github.com/lukecyca/pyzabbix/blob/master/CHANGELOG.md)