[c] Update permission for publishing #7
This file contains 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: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-django-headless-cms-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-lint | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pip install -r requirements-tests.txt | |
- name: Lint | |
run: bash scripts/lint.sh | |
# test: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# python-version: ["3.9", "3.10", "3.11"] | |
# fail-fast: false | |
# steps: | |
# - name: Dump GitHub context | |
# env: | |
# GITHUB_CONTEXT: ${{ toJson(github) }} | |
# run: echo "$GITHUB_CONTEXT" | |
# - uses: actions/checkout@v3 | |
# - name: Set up Python | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - uses: actions/cache@v3 | |
# id: cache | |
# with: | |
# path: ${{ env.pythonLocation }} | |
# key: ${{ runner.os }}-python-${{ env.pythonLocation }}-django-headless-cms-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-test | |
# - name: Install Dependencies | |
# if: steps.cache.outputs.cache-hit != 'true' | |
# run: pip install -r requirements-tests.txt | |
# - run: mkdir coverage | |
# - name: Test | |
# run: coverage run -m pytest tests | |
# env: | |
# COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} | |
# CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} | |
# - name: Store coverage files | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: coverage | |
# path: coverage |