aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Denhartog <ben@sudoforge.com>2020-12-15 00:26:18 -0700
committerTrygve Aaberge <trygveaa@gmail.com>2021-03-06 12:39:53 +0100
commitb08dcca160687e54ab0773e44729cfd12e5f0100 (patch)
treeaeee99bc8ace388afcafffbeb1bc86cd04777424
parentda7a9643b5d2512b749e711d5af12259f90517b7 (diff)
downloadwee-slack-b08dcca160687e54ab0773e44729cfd12e5f0100.tar.gz
feat(ci): use github actions instead of travis-ci
This patch removes the configuration for Travis-CI, and adds configuration for Github Actions. Co-authored-by: Ashish Kulkarni <ashish@kulkarni.dev>
-rw-r--r--.github/workflows/wee-slack.yml103
-rw-r--r--.travis.yml23
2 files changed, 103 insertions, 23 deletions
diff --git a/.github/workflows/wee-slack.yml b/.github/workflows/wee-slack.yml
new file mode 100644
index 0000000..f4db256
--- /dev/null
+++ b/.github/workflows/wee-slack.yml
@@ -0,0 +1,103 @@
+name: wee-slack
+on: [push, pull_request]
+
+jobs:
+ lint:
+ if: >
+ github.event_name == 'push' || (
+ github.event_name == 'pull_request' &&
+ github.event.pull_request.head.repo.full_name != github.repository
+ )
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python_version: [2.7, 3.7]
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python (${{ matrix.python_version }})
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python_version }}
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: lint-pip
+ with:
+ path: ${{ env.pythonLocation }}
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install Pipenv
+ run: |
+ pip install --upgrade pipenv
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: lint-pipenv
+ with:
+ path: "$GITHUB_WORKSPACE/.venv"
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install dependencies
+ run: |
+ pipenv install --dev --skip-lock
+
+ - name: Lint with Flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ pipenv run flake8 .
+
+ # exit-zero treats all errors as warnings.
+ pipenv run flake8 . --exit-zero --select=C,E,F,W
+
+ test:
+ if: >
+ github.event_name == 'push' || (
+ github.event_name == 'pull_request' &&
+ github.event.pull_request.head.repo.full_name != github.repository
+ )
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python_version: [2.7, 3.7]
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python (${{ matrix.python_version }})
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python_version }}
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: test-pip
+ with:
+ path: ${{ env.pythonLocation }}
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install Pipenv
+ run: |
+ pip install --upgrade pipenv
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: test-pipenv
+ with:
+ path: "$GITHUB_WORKSPACE/.venv"
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install dependencies
+ run: |
+ pipenv install --dev --skip-lock
+
+ - name: python/test
+ run: |
+ pipenv run pytest
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5b43ff3..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-dist: xenial
-language: python
-python:
- - "2.7"
- - "3.7"
-cache: pip
-
-install:
- - pip install pipenv
- - pipenv install --dev --system
-
-before_script:
- # stop the build if there are Python syntax errors or undefined names
- - flake8 .
- # exit-zero treats all errors as warnings.
- - flake8 . --exit-zero --select=C,E,F,W
-
-script:
- - pytest
-
-notifications:
- irc: "chat.freenode.net#wee-slack-dev"
- email: false