From 304ad850b7dfd6591efde25892be99a856bc41a1 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Wed, 15 Jun 2022 02:04:34 +0200 Subject: [PATCH] Try new actions --- .github/workflows/python.yml | 103 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 15 ----- 2 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/python.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..c68c2d4 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,103 @@ +name: Python CI + +on: + push: + +jobs: + dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: pip3 install -r requirements.txt -r requirements-dev.txt + tests: + needs: [dependencies] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: pip3 install -r requirements.txt -r requirements-dev.txt + - name: Run Pytest + run: pytest tests + linting: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: pip3 install -r requirements.txt -r requirements-dev.txt + - name: Linting + run: pylint didier database + typing: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: pip3 install -r requirements.txt -r requirements-dev.txt + - name: Typing + run: mypy didier database + formatting: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: pip3 install -r requirements.txt -r requirements-dev.txt + - name: Formatting + run: black --check didier database diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 0c33832..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Run Tests - -on: - push: - -jobs: - python-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.9.5' - - run: pip3 install -r requirements.txt - - run: pytest tests \ No newline at end of file