-
Notifications
You must be signed in to change notification settings - Fork 0
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 #18 from worldemar/docker-ci
Move CI to Docker for portability
- Loading branch information
Showing
5 changed files
with
267 additions
and
262 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 |
---|---|---|
@@ -1,33 +1,16 @@ | ||
name: test bundles | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
bundle: | ||
runs-on: windows-2022 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
- name: set up npm | ||
run: | | ||
npm install -g uglify-js | ||
npm install -g html-minifier | ||
npm install -g inline-scripts | ||
- name: generate QR | ||
run: | | ||
python qrs.py --htmldirs=apps --builddir=bundles | ||
name: Test Bundles | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
bundle: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build ci environment | ||
run: | | ||
docker build --pull --rm -t qrapps:ci . | ||
- name: generate QR | ||
run: | | ||
docker run --rm -v .:/src -w /src qrapps:ci qrs.py --htmldirs=apps --builddir=bundles |
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,21 +1,16 @@ | ||
name: prospector | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
prospector: | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-contrib.txt | ||
- name: lint with prospector | ||
run: | | ||
prospector | ||
name: Prospector | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
prospector: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build ci environment | ||
run: | | ||
docker build --pull --rm -t qrapps:ci . | ||
- name: lint with prospector | ||
run: | | ||
docker run --rm -v .:/src -w /src --entrypoint=prospector qrapps:ci |
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,49 +1,32 @@ | ||
name: release bundles | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
bundle: | ||
runs-on: windows-2022 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
- name: set up npm | ||
run: | | ||
npm install -g uglify-js | ||
npm install -g html-minifier | ||
npm install -g inline-scripts | ||
- name: generate QR | ||
run: | | ||
python qrs.py --htmldirs=apps --builddir=bundles | ||
- name: generate README.md | ||
run: | | ||
Remove-Item -Path docs -Force -Recurse | ||
mv bundles docs | ||
git checkout -- docs/_config.yml | ||
python release.py | ||
tree /f docs | ||
- name: release | ||
run: | | ||
git config --global user.email "woldemar@mimas.ru" | ||
git config --global user.name "Vladimir Looze" | ||
git add docs | ||
git commit -m "release new bundles" | ||
git push origin main | ||
name: Release Bundles | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
bundle: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build ci environment | ||
run: | | ||
docker build --pull --rm -t qrapps:ci . | ||
- name: generate QR | ||
run: | | ||
docker run --rm -v .:/src -w /src qrapps:ci qrs.py --htmldirs=apps --builddir=bundles | ||
- name: generate README.md | ||
run: | | ||
rm -rf docs | ||
mv bundles docs | ||
git checkout -- docs/_config.yml | ||
docker run --rm -v .:/src -w /src qrapps:ci release.py | ||
tree /f docs | ||
- name: release | ||
run: | | ||
git config --global user.email "woldemar@mimas.ru" | ||
git config --global user.name "Vladimir Looze" | ||
git add docs | ||
git commit -m "release new bundles" | ||
git push origin main | ||
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,44 @@ | ||
# Self-contained environment | ||
# | ||
# Build environment: | ||
# docker build --pull --rm -t qrapps:ci . | ||
# | ||
# Run interactive shell, useful for debugging: | ||
# docker run --rm -it -v .:/src -w /src --entrypoint=bash qrapps:ci | ||
# | ||
# Check code quality: | ||
# docker run --rm -it -v .:/src -w /src --entrypoint=prospector qrapps:ci | ||
# | ||
# Convert everything to QR codes: | ||
# docker run --rm -it -v .:/src -w /src qrapps:ci qrs.py --htmldirs=apps --builddir=bundles | ||
# | ||
# Convert single app to QR code: | ||
# docker run --rm -it -v .:/src -w /src qrapps:ci qr.py --htmldir=apps/demo-clock --builddir=bundles | ||
# | ||
# Then run commands from within the build environment, for example | ||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl autoreconf -fi | ||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./configure --without-ssl --without-libpsl | ||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl make | ||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./scripts/maketgz 8.7.1 | ||
|
||
from debian:12 | ||
|
||
RUN apt-get -y update && apt-get install -y --no-install-recommends \ | ||
python3-pip=23.0.1+dfsg-1 \ | ||
python3-venv=3.11.2-1+b1 \ | ||
npm=9.2.0~ds1-1 \ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN --mount=type=bind,source=requirements.txt,target=requirements.txt \ | ||
--mount=type=bind,source=requirements-contrib.txt,target=requirements-contrib.txt \ | ||
python3 -m venv /venv && \ | ||
/venv/bin/python3 -m pip install --upgrade pip && \ | ||
/venv/bin/python3 -m pip install -r requirements.txt && \ | ||
/venv/bin/python3 -m pip install -r requirements-contrib.txt | ||
|
||
RUN npm install -g uglify-js html-minifier inline-scripts | ||
|
||
ENV PATH="/venv/bin:${PATH}" | ||
|
||
ENTRYPOINT ["/venv/bin/python3"] |
Oops, something went wrong.