Update actions configurations; re-add Python cache

This commit is contained in:
Christopher C. Wells 2022-06-02 20:11:49 -07:00
parent 815d881eeb
commit 544babd8eb
3 changed files with 34 additions and 44 deletions

View File

@ -9,40 +9,30 @@ on:
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: babybuddy.settings.ci
PIPENV_VENV_IN_PROJECT: enabled
strategy: strategy:
matrix: matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10' ] python-version: [ '3.7', '3.8', '3.9', '3.10' ]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3
uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v2 - uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
- name: Install Python dependencies
- run: |
python -m pip install --upgrade pipenv wheel
pipenv install --dev
- uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
- run: npm install -g gulp-cli - run: |
- run: npm install npm install -g gulp-cli
- name: Install pipenv npm install
run: | gulp lint
python -m pip install --upgrade pipenv wheel gulp coverage
# - name: Cache Python dependencies
# id: cache-pipenv
# uses: actions/cache@v2
# with:
# path: ./.venv
# key: ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv-
- name: Install dependencies
# if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --dev
- run: gulp lint
- run: gulp coverage
- name: Submit results to Coveralls - name: Submit results to Coveralls
uses: AndreMiras/coveralls-python-action@develop uses: AndreMiras/coveralls-python-action@develop
with: with:
@ -66,12 +56,11 @@ jobs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps: steps:
- name: Checkout main - name: Checkout main
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Deploy docs - name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master uses: mhausenblas/mkdocs-deploy-gh-pages@master
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.github_token }}
REQUIREMENTS: docs/requirements.txt REQUIREMENTS: docs/requirements.txt
# deploy: # deploy:
# needs: test # needs: test

View File

@ -10,8 +10,6 @@ jobs:
analyze: analyze:
name: Analyze name: Analyze
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
PIPENV_VENV_IN_PROJECT: enabled
permissions: permissions:
actions: read actions: read
contents: read contents: read
@ -22,21 +20,24 @@ jobs:
language: [ 'javascript', 'python' ] language: [ 'javascript', 'python' ]
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v3
with: with:
python-version: '3.x' python-version: '3.x'
- name: Install dependencies - uses: actions/cache@v3
run: | with:
export PATH="$HOME/.local/bin:$PATH" path: ~/.local/share/virtualenvs
python3 -m pip install --upgrade pipenv wheel key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
pipenv install
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v2
with: with:
config-file: ./.github/codeql/codeql-config.yml config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
setup-python-dependencies: false setup-python-dependencies: false
- name: Install dependencies
run: |
python -m pip install --upgrade pipenv wheel
pipenv install
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v2

View File

@ -8,10 +8,10 @@ jobs:
name: Reset name: Reset
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v3
with: with:
python-version: "3.10" python-version: '3.x'
- uses: actions/cache@v3 - uses: actions/cache@v3
with: with:
path: ~/.local/share/virtualenvs path: ~/.local/share/virtualenvs
@ -22,7 +22,7 @@ jobs:
run: pipenv install run: pipenv install
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: "16" node-version: '16'
- name: Install Railway CLI - name: Install Railway CLI
run: npm i -g @railway/cli run: npm i -g @railway/cli
- name: Reset demo database - name: Reset demo database