diff --git a/.github/workflows/changelog_check.yml b/.github/workflows/changelog_check.yml new file mode 100644 index 00000000..26c17e42 --- /dev/null +++ b/.github/workflows/changelog_check.yml @@ -0,0 +1,16 @@ +name: Changelog +on: [pull_request] + +jobs: + check-newsfile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + - uses: actions/setup-python@v2 + with: + python-version: "3.7" + - run: python -m pip install towncrier + - run: python -m towncrier.check --compare-with=${{ github.base_ref }} \ No newline at end of file diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 00000000..4d128ac7 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,49 @@ +name: Linting and tests +on: + pull_request: + push: + branches: ["main"] +jobs: + check-code-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.6' + - run: python -m pip install -e . + - run: black --check --diff sydent/ tests/ matrix_is_test/ setup.py + - run: flake8 sydent/ tests/ matrix_is_test/ setup.py + + run-unit-tests: + needs: [check-code-style] + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.x'] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install -e . + - run: trial tests + + run-matrix-is-tests: + needs: [check-code-style] + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.x'] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install -e . + - run: pip install git+https://github.com/matrix-org/matrix-is-tester.git + - run: trial matrix_is_tester + + \ No newline at end of file diff --git a/changelog.d/346.misc b/changelog.d/346.misc new file mode 100644 index 00000000..3d04e14e --- /dev/null +++ b/changelog.d/346.misc @@ -0,0 +1 @@ +Add github actions for unittests (python 3.6 and 3.9), matrix_is_tester tests (python 3.6 and 3.9), towncrier checks and black and flake8 codestyle checks. \ No newline at end of file diff --git a/setup.py b/setup.py index 58072062..6e64cf12 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,8 @@ def read(fname): "six>=1.10", "pyyaml>=3.11", "mock>=3.0.5", + "flake8==3.9.2", + "black==21.5b1", ], # make sure we package the sql files include_package_data=True,