Added {% raw %} and {% endraw %} to allow jinja to parse the tempaltes correctly.

This commit is contained in:
Arnav Choudhury 2020-09-19 02:31:07 +05:30
parent ed701a042b
commit c061fba40e
3 changed files with 7 additions and 7 deletions

View File

@ -177,4 +177,4 @@ debug:
.. _GitLab CI: https://docs.gitlab.com/ee/ci/ .. _GitLab CI: https://docs.gitlab.com/ee/ci/
.. _Github CI: https://docs.github.com/en/actions .. _Github Actions: https://docs.github.com/en/actions

View File

@ -245,7 +245,7 @@ def test_github_invokes_flake8_and_pytest(
assert result.project.basename == context["project_slug"] assert result.project.basename == context["project_slug"]
assert result.project.isdir() assert result.project.isdir()
with open(f"{result.project}/.github/workflows/.github-ci.yml", "r") as github_yml: with open(f"{result.project}/.github/workflows/ci.yml", "r") as github_yml:
try: try:
github_config = yaml.safe_load(github_yml) github_config = yaml.safe_load(github_yml)
assert github_config["flake8"]["script"] == ["flake8"] assert github_config["flake8"]["script"] == ["flake8"]

View File

@ -1,12 +1,10 @@
name: Github-CI name: CI
# Enable Buildkit and let compose use it to speed up image building # Enable Buildkit and let compose use it to speed up image building
env: env:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1 COMPOSE_DOCKER_CLI_BUILD: 1
on: on:
pull_request: pull_request:
branches: [ "master" ] branches: [ "master" ]
@ -17,7 +15,6 @@ on:
paths-ignore: [ "docs/**" ] paths-ignore: [ "docs/**" ]
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -47,6 +44,7 @@ jobs:
- name: Checkout Code Repository - name: Checkout Code Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
{% if cookiecutter.use_docker == 'y' -%} {% if cookiecutter.use_docker == 'y' -%}
- name: Build the Stack - name: Build the Stack
run: docker-compose -f local.yml build run: docker-compose -f local.yml build
@ -61,6 +59,7 @@ jobs:
- name: Tear down the Stack - name: Tear down the Stack
run: docker-compose down run: docker-compose down
{%- else %} {%- else %}
- name: Set up Python 3.8 - name: Set up Python 3.8
@ -73,6 +72,7 @@ jobs:
run: | run: |
echo "::set-output name=dir::$(pip cache dir)" echo "::set-output name=dir::$(pip cache dir)"
{% raw %}
- name: Cache pip Project Dependencies - name: Cache pip Project Dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -82,6 +82,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/local.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/local.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
{% endraw %}
- name: Install Dependencies - name: Install Dependencies
run: | run: |
@ -91,5 +92,4 @@ jobs:
- name: Test with pytest - name: Test with pytest
run: pytest run: pytest
{%- endif %} {%- endif %}