diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..fab446e1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,26 @@ +name: customer themes + +on: + push: + branches: ['juniper/tahoe'] + pull_request: + +jobs: + test: + runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: [3.8] + tox-env: + - verify + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install tox + - name: Test with tox + run: tox -e ${{ matrix.tox-env }} diff --git a/.gitignore b/.gitignore index e43b0f98..ae998703 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.tox diff --git a/README.md b/README.md new file mode 100644 index 00000000..b28a8091 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Customer-specific theme +This repo has the customer themes. + +## How to: Compile the `amc-specific.scss` file + +On your devstack run: + +``` +$ tox -e compile +``` + +Commit the changes and make a pull request. diff --git a/scripts/compile.sh b/scripts/compile.sh new file mode 100644 index 00000000..91cd0255 --- /dev/null +++ b/scripts/compile.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -ex + +# Run via `tox -e compile` +pysassc cms/static/sass/amc-specific.scss cms/static/css/amc-specific.css diff --git a/scripts/verify.sh b/scripts/verify.sh new file mode 100644 index 00000000..1f95196a --- /dev/null +++ b/scripts/verify.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -ex + +# Run this script via `$ tox -e verify` +if git diff-index --quiet HEAD --; then + echo "Success: The CSS file is in sync with the SCSS file." +else + echo "Error: CSS is out of sync" + echo "=== Start: Git diff ===" + git --no-pager diff + echo "=== End: Git diff ===" + echo 'Error: The CSS file is out of sync with the SCSS file.' + echo 'The git diff above shows the difference.' + echo 'Please use "$ tox -e compile" locally to compile the SCSS file.' +fi diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..9aa55c3f --- /dev/null +++ b/tox.ini @@ -0,0 +1,19 @@ +[tox] +envlist = compile,verify +skipsdist = True + +[testenv] +basepython=python3 +deps = libsass==0.20.1 +allowlist_externals = + bash + +[testenv:compile] +commands = + bash {toxinidir}/scripts/compile.sh + +[testenv:verify] +commands = + bash {toxinidir}/scripts/compile.sh + bash {toxinidir}/scripts/verify.sh +