Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
2,544 additions
and
1,449 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,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,44 +1,110 @@ | ||
--- | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
# Code style checks | ||
health: | ||
name: Code health check | ||
name: code health check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Asciinema | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
- name: checkout asciinema | ||
uses: actions/checkout@v3 | ||
- name: setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: pip install pycodestyle twine setuptools>=38.6.0 cmarkgfm | ||
python-version: "3.10" | ||
- name: install dependencies | ||
run: pip install build cmarkgfm pycodestyle twine | ||
- name: Run pycodestyle | ||
run: find . -name \*.py -exec pycodestyle --ignore=E501,E402,E722 {} + | ||
run: > | ||
find . | ||
-name '*\.py' | ||
-exec pycodestyle --ignore=E402,E501,E722,W503 "{}" \+ | ||
- name: Run twine | ||
run: | | ||
python setup.py --quiet sdist | ||
python3 -m build | ||
twine check dist/* | ||
# Asciinema checks | ||
asciinema: | ||
name: Asciinema - py${{ matrix.python }} | ||
name: Asciinema | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.7, 3.8, 3.9] | ||
python: | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
env: | ||
TERM: dumb | ||
steps: | ||
- name: Checkout Asciinema | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
- name: checkout Asciinema | ||
uses: actions/checkout@v3 | ||
- name: setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install dependencies | ||
run: pip install nose | ||
- name: Run Asciinema tests | ||
- name: install dependencies | ||
run: pip install pytest | ||
- name: run Asciinema tests | ||
run: script -e -c make test | ||
build_distros: | ||
name: build distro images | ||
strategy: | ||
matrix: | ||
distros: | ||
- alpine | ||
- arch | ||
- centos | ||
- debian | ||
- fedora | ||
- ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Authenticate to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: "${{ github.actor }}" | ||
password: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: "Build ${{ matrix.distros }} image" | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: "tests/distros/Dockerfile.${{ matrix.distros }}" | ||
tags: | | ||
"ghcr.io/${{ github.repository }}:${{ matrix.distros }}" | ||
push: true | ||
test_distros: | ||
name: integration test distro images | ||
needs: build_distros | ||
strategy: | ||
matrix: | ||
distros: | ||
- alpine | ||
- arch | ||
- centos | ||
- debian | ||
- fedora | ||
- ubuntu | ||
runs-on: ubuntu-latest | ||
container: | ||
image: "ghcr.io/${{ github.repository }}:${{ matrix.distros }}" | ||
credentials: | ||
username: "${{ github.actor }}" | ||
password: "${{ secrets.GITHUB_TOKEN }}" | ||
# https://github.community/t/permission-problems-when-checking-out-code-as-part-of-github-action/202263 | ||
options: "--interactive --tty --user=1001:121" | ||
steps: | ||
- name: checkout Asciinema | ||
uses: actions/checkout@v3 | ||
- name: run integration tests | ||
env: | ||
TERM: dumb | ||
shell: 'script --return --quiet --command "bash {0}"' | ||
run: make test.integration |
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,14 @@ | ||
--- | ||
name: pre-commit | ||
on: | ||
- pull_request | ||
- push | ||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- uses: pre-commit/action@v2.0.3 |
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,39 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/adrienverge/yamllint | ||
rev: v1.26.3 | ||
hooks: | ||
- id: yamllint | ||
- repo: https://github.com/myint/autoflake | ||
rev: v1.4 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
- --in-place | ||
- --recursive | ||
- --expand-star-imports | ||
- --remove-all-unused-imports | ||
- --remove-duplicate-keys | ||
- --remove-unused-variables | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v0.931" | ||
hooks: | ||
- id: mypy |
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
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,22 +1,38 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
locales \ | ||
python3 \ | ||
python3-setuptools | ||
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 | ||
RUN mkdir /usr/src/app | ||
COPY setup.cfg /usr/src/app | ||
COPY setup.py /usr/src/app | ||
COPY *.md /usr/src/app/ | ||
# syntax=docker/dockerfile:1.3 | ||
|
||
FROM docker.io/library/ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
locales \ | ||
python3 \ | ||
python3-pip \ | ||
&& localedef \ | ||
-i en_US \ | ||
-c \ | ||
-f UTF-8 \ | ||
-A /usr/share/locale/locale.alias \ | ||
en_US.UTF-8 | ||
|
||
COPY pyproject.toml setup.cfg *.md /usr/src/app/ | ||
COPY doc/*.md /usr/src/app/doc/ | ||
COPY man/asciinema.1 /usr/src/app/man/ | ||
COPY asciinema /usr/src/app/asciinema | ||
COPY asciinema/ /usr/src/app/asciinema/ | ||
COPY README.md LICENSE /usr/src/app/ | ||
|
||
WORKDIR /usr/src/app | ||
RUN python3 setup.py install | ||
ENV LANG en_US.utf8 | ||
ENV SHELL /bin/bash | ||
ENV USER docker | ||
|
||
RUN pip3 install . | ||
|
||
WORKDIR /root | ||
|
||
ENV LANG="en_US.utf8" | ||
ENV SHELL="/bin/bash" | ||
|
||
ENTRYPOINT ["/usr/local/bin/asciinema"] | ||
CMD ["--help"] | ||
|
||
# vim:ft=dockerfile |
Oops, something went wrong.