Merge pull request #889 from djlint/dev #57
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: Demo | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
demo: | |
strategy: | |
matrix: | |
include: | |
- tool: django | |
repo: https://github.com/django/django | |
profile: django | |
args: --indent 2 | |
- tool: wagtail | |
repo: https://github.com/wagtail/wagtail | |
profile: django | |
args: --indent 4 | |
- tool: pallets | |
repo: https://github.com/pallets/website | |
profile: jinja | |
args: --indent 2 | |
- tool: apostrophe | |
repo: https://github.com/apostrophecms/apostrophe | |
profile: nunjucks | |
args: --indent 2 | |
- tool: bolt | |
repo: https://github.com/bolt/core | |
profile: nunjucks | |
args: --indent 4 | |
- tool: sylius | |
repo: https://github.com/Sylius/Sylius | |
profile: nunjucks | |
args: --indent 2 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
cache: poetry | |
check-latest: true | |
- run: poetry install --only main --sync --no-root --no-interaction | |
- run: git clone --depth 1 '${{ matrix.repo }}' '${{ matrix.tool }}_raw' | |
- run: mkdir '${{ matrix.tool }}_source' | |
- run: find "${{ matrix.tool }}_raw" -iname '*.html*' -exec mv -t "${{ matrix.tool }}_source/" {} + | |
- run: rm -rf '${{ matrix.tool }}_raw' | |
- run: | | |
git init | |
git branch -m 'demo-${{ matrix.tool }}' | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add -A | |
git commit -m 'git clone ${{ matrix.repo }}' | |
poetry run python -m djlint "../${{ matrix.tool }}-source" --profile=${{ matrix.profile }} --reformat --warn --quiet ${{ matrix.args }} | |
git add -A | |
git commit -m "Reformat with djLint v$(poetry version --short)" | |
git push --force 'https://github.com/djlint/djlint' 'demo-${{ matrix.tool }}' | |
working-directory: '${{ matrix.tool }}_source' |