-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from appsembler/omar/tox
Initial tox and gitbub actions: avoid getting stale css
- Loading branch information
Showing
7 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.DS_Store | ||
.tox |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Run this script via `$ tox -e verify` | ||
if git diff --no-ext-diff --quiet --exit-code; 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.' | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|