Skip to content

Commit

Permalink
Merge pull request #153 from appsembler/omar/tox
Browse files Browse the repository at this point in the history
Initial tox and gitbub actions: avoid getting stale css
  • Loading branch information
OmarIthawi authored Apr 8, 2021
2 parents e0f3461 + 6db995d commit 1685c9e
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.tox
12 changes: 12 additions & 0 deletions README.md
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.
3 changes: 3 additions & 0 deletions cms/static/css/amc-specific.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ body.view-settings .group-settings.basic .list-actions {
max-width: 48rem;
width: 80%;
margin-bottom: 5rem; }

.xblock .mentoring .copyright {
display: none; }
5 changes: 5 additions & 0 deletions scripts/compile.sh
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
16 changes: 16 additions & 0 deletions scripts/verify.sh
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
19 changes: 19 additions & 0 deletions tox.ini
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

0 comments on commit 1685c9e

Please sign in to comment.