diff options
author | Benjamin Denhartog <ben@sudoforge.com> | 2020-12-15 00:26:18 -0700 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2021-03-06 12:39:53 +0100 |
commit | b08dcca160687e54ab0773e44729cfd12e5f0100 (patch) | |
tree | aeee99bc8ace388afcafffbeb1bc86cd04777424 /.github | |
parent | da7a9643b5d2512b749e711d5af12259f90517b7 (diff) | |
download | wee-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>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/wee-slack.yml | 103 |
1 files changed, 103 insertions, 0 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 |