Merge pull request #2 from calmmage/new-workflow #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python package | |
| on: [ push ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ "3.12" ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 2.1.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Setup Poetry cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/pypoetry | |
| ~/.cache/pip | |
| .venv | |
| key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry-${{ matrix.python-version }}- | |
| ${{ runner.os }}-poetry- | |
| - name: Install dependencies | |
| run: | | |
| poetry install --only main,test,extras | |
| - name: Test with pytest | |
| run: | | |
| poetry run pytest tests/ | |
| # env: | |
| # GITHUB_API_TOKEN: ${{ secrets.API_TOKEN_GITHUB }} |