diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..8f2b102 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 23 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ['python'] + # CodeQL supports [ $supported-codeql-languages ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..87b8583 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +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.x' + - 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/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..89d8c41 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,43 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + os: [ubuntu-latest, macOS-latest, windows-latest] + include: + - python-version: pypy3 + os: ubuntu-latest + + 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: | + pip install --upgrade keyring==21.4.0 setuptools wheel twine coveralls tox + - name: Run pylint & codestyle & unit tests + run: | + tox + - name: Publish coverage report + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + coveralls + - name: Run twine check + run: | + python setup.py sdist bdist_wheel + twine check dist/* + - name: Run integration tests + if: matrix.os == 'ubuntu-latest' + run: | + tox -e integration diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index 825b41a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -dist: xenial -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - pip install --upgrade keyring==21.4.0 setuptools wheel twine - - pip install coveralls tox -# command to run tests -script: - - tox - - if [[ `python --version` =~ 3.7 ]]; then coveralls; fi - - tox -e integration - - python setup.py sdist bdist_wheel - - twine check dist/* diff --git a/HISTORY.md b/HISTORY.md index 1707ec8..669b7e2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,7 @@ Release History =============== -1.1 (2020-12-??) +1.1 (2020-12-31) ----------------- - Rewrite documentation and add more examples - `Jenkins.build_job()` and `Project.build()` accept key word argments instead of dict diff --git a/README.md b/README.md index c65e960..3462a99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build Status](https://travis-ci.com/joelee2012/api4jenkins.svg?branch=master)](https://travis-ci.com/joelee2012/api4jenkins) +![Tests](https://github.com/joelee2012/api4jenkins/workflows/Tests/badge.svg?branch=master) +![CodeQL](https://github.com/joelee2012/api4jenkins/workflows/CodeQL/badge.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/joelee2012/api4jenkins/badge.svg?branch=master)](https://coveralls.io/github/joelee2012/api4jenkins?branch=master) # api4jenkins