From 9993a81e519b7da78de19ea8a72ebda3c60f94dd Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Sun, 12 Sep 2021 09:43:28 -0400 Subject: [PATCH] Add first draft of Github CI pipeline. --- .github/workflows/testing.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..214a54d --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,53 @@ +name: Run tests +on: + push: + branches: ["*"] + tags-ignore: ["*"] + pull_request: + branches: ["*"] + +jobs: + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + python -m pip install -r requires/lint.txt + - name: Flake8 + run: | + flake8 sprockets tests.py + test: + 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 setuptools + python -m pip install -r requires/testing.txt . + - name: Run tests + run: | + coverage run -m unittest tests.py + coverage report + coverage xml -o ./coverage.xml + - name: Send coverage data to codecov.io + uses: codecov/codecov-action@v1.3.2 + if: github.event_name == 'push' + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests + fail_ci_if_error: true