Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial tox and gitbub actions: avoid getting stale css #153

Merged
merged 2 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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