From 751b133cddb504faaf77a6a39054515ebdf57c4f Mon Sep 17 00:00:00 2001 From: Brandon Wolfe Date: Mon, 22 Feb 2021 13:13:22 -0600 Subject: [PATCH] Move to Github Actions --- .github/workflows/codeql-analysis.yml | 45 +++++++++++++++++++++++++++ .github/workflows/run-tests.yml | 40 ++++++++++++++++++++++++ .travis.yml | 17 ---------- 3 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..4f28657 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,45 @@ +name: "Code scanning - action" + +on: + pull_request: + schedule: + - cron: '0 7 * * 1' + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # 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/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..1cf035d --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,40 @@ +name: tests +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + run-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ 3.6, 3.7, 3.8 ] + include: + - 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: | + python -m pip install --upgrade pip + pip install . + pip install coveralls mock pytest-cov + + - name: Run Unit Tests + run: | + pytest --cov SmtpLibrary -v tests/base.py + + - name: Coveralls + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + flag-name: run-${{ matrix.python-version }} + parallel: true + run: | + coveralls --service=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ae19fb2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: python - -python: - - "3.6" - -install: - # install python requirements - - pip install . - - pip install coveralls - - pip install pytest-cov - -script: - # run tests - - pytest --cov SmtpLibrary -v tests/base.py - -after_success: - - coveralls