diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2df1627 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d393409 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - 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 + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0edb080..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: python -sudo: false -dist: xenial -services: - - docker - -cache: - directories: - - "${HOME}/.cache" -matrix: - include: - - python: 3.7 - env: TOXENV=py37 - - python: 3.8 - env: TOXENV=py38 -install: -- pip install tox -script: -- tox -- docker run -v $(pwd)/policy:/opt/opa/policy openpolicyagent/opa test -v /opt/opa/policy -notifications: - email: false -deploy: - provider: pypi - user: "forsetisecurity" - password: - secure: "ftQxt89bF/szBaUAxG2Hkf8NdJWIquNmCjZjuw5Jn9PliHZ852vTcHc1zFLZ45UxsLRTTApG166UnCNNR17CKV/n13V5wrl3Azy6NDDebq9JXWFPQuLtZL8hpQaX4ahh9jskKPzC/cAI8NC6ARl3Gh6oANxwQADhM8rPfga8EQdbvyjVplQiLaFlzHgaaQHmrSI8GIj/CT1F185whThe7A39G78IVzX/ppSnN4UuPHUNHZkbmcTQHQAlMhI/EDAsN2OQn18OAtisZnjOsgBBOTAKcbmKd79GpWJF8aCLrgNkzEDL8dL/mJbjX5ICtygY1Ivj63Hr4fw+f4ywVd0CsvXCMv9Qc3mqy8XdWtKKqyjuOs0ADde4MDT+RImhcSZ8FntSXcBujYJYQBsvtbp8mzcLS3n4YfjYakqwWByX9rQUu2aj98FjctVQcsZJLZND42qzbJNKeLznqqM7MCdmqHB0FwGvIlFWMPh42mBP7KCo/UNWqLO7lMNOjzS3ZlooI4TcPhTYfsoi9C+Z85jpKEtr/6KOIRHTQkH8JqW+7nqlyDB9KvyIzpXQam/ltm+Bhm5idorGywz3O5AqhZNWjPJzeEu+yzjHBp22HdnRPBKXVES5mkuDUcmjHbtxSq57iqPpGkAU7Z/nv3Xrq8sib1xBxVOGVuXnZEvn1lP5xWY=" - on: - tags: true - skip_existing: true