Compare commits
7 Commits
8-write-te
...
10-deploy-
Author | SHA1 | Date | |
---|---|---|---|
d0becd4063
|
|||
560e9ee6db
|
|||
db413e4a35
|
|||
e8fc6d0816
|
|||
be7efbbfa7
|
|||
b8161eef93
|
|||
bcfd13442f
|
9
.gitignore
vendored
9
.gitignore
vendored
@ -4,3 +4,12 @@
|
|||||||
.coverage
|
.coverage
|
||||||
|
|
||||||
venv
|
venv
|
||||||
|
|
||||||
|
*.aux
|
||||||
|
*.log
|
||||||
|
*.nav
|
||||||
|
*.out
|
||||||
|
*.pdf
|
||||||
|
*.snm
|
||||||
|
*.synctex.gz
|
||||||
|
*.toc
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
stages:
|
stages:
|
||||||
- linting
|
- linting
|
||||||
- test
|
- test
|
||||||
|
- compile_slides
|
||||||
|
|
||||||
|
|
||||||
flake8:
|
flake8:
|
||||||
@ -27,3 +28,22 @@ test:
|
|||||||
before_script:
|
before_script:
|
||||||
- pip install pytest pytest-cov --no-cache-dir
|
- pip install pytest pytest-cov --no-cache-dir
|
||||||
script: pytest --showlocals --cov=main --cov=main_test --cov-report=term-missing .
|
script: pytest --showlocals --cov=main --cov=main_test --cov-report=term-missing .
|
||||||
|
|
||||||
|
slides:
|
||||||
|
stage: compile_slides
|
||||||
|
image: aergus/latex
|
||||||
|
before_script:
|
||||||
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- echo "$SSH_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- chmod 0700 ~/.ssh
|
||||||
|
- ssh-keyscan ynerant.fr >> ~/.ssh/known_hosts
|
||||||
|
- chmod 0644 ~/.ssh/known_hosts
|
||||||
|
script:
|
||||||
|
- latexmk -cd -pdf slides/seminaire-ci.tex
|
||||||
|
- scp slides/seminaire-ci.pdf gitlab-ci@ynerant.fr:gitlab-ftp/seminaire-ci.pdf
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- slides/seminaire-ci.pdf
|
||||||
|
expire_in: 1 mo
|
||||||
|
48
main.py
48
main.py
@ -14,7 +14,7 @@ from random import choice
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main(): # pragma: nocover
|
||||||
"""
|
"""
|
||||||
Fonction principale, qui va attendre les instructions de l'utilisateur.
|
Fonction principale, qui va attendre les instructions de l'utilisateur.
|
||||||
"""
|
"""
|
||||||
@ -51,16 +51,16 @@ def seminaire():
|
|||||||
"""
|
"""
|
||||||
Affiche les slides du séminaire.
|
Affiche les slides du séminaire.
|
||||||
"""
|
"""
|
||||||
print("\x4c\x61\x69\x73\x73\x65\x20\x74\x6f\x6d\x62\x65"
|
return "\x4c\x61\x69\x73\x73\x65\x20\x74\x6f\x6d\x62\x65" \
|
||||||
"\x72\x2c\x20\x74\x6f\x6e\x20\x74\x72\x75\x63\x20"
|
"\x72\x2c\x20\x74\x6f\x6e\x20\x74\x72\x75\x63\x20" \
|
||||||
"\x65\x73\x74\x20\x74\x72\x6f\x70\x20\x62\x65\x75"
|
"\x65\x73\x74\x20\x74\x72\x6f\x70\x20\x62\x65\x75" \
|
||||||
"\x67\x75\xe9\x2c\x20\x74\x75\x20\x64\x65\x76\x72"
|
"\x67\x75\xe9\x2c\x20\x74\x75\x20\x64\x65\x76\x72" \
|
||||||
"\x61\x69\x73\x20\x70\x61\x73\x73\x65\x72\x20\x64"
|
"\x61\x69\x73\x20\x70\x61\x73\x73\x65\x72\x20\x64" \
|
||||||
"\x75\x20\x74\x65\x6d\x70\x73\x20\xe0\x20\xe9\x63"
|
"\x75\x20\x74\x65\x6d\x70\x73\x20\xe0\x20\xe9\x63" \
|
||||||
"\x72\x69\x72\x65\x20\x64\x65\x73\x20\x74\x65\x73"
|
"\x72\x69\x72\x65\x20\x64\x65\x73\x20\x74\x65\x73" \
|
||||||
"\x74\x73\x20\x65\x74\x20\x66\x61\x69\x72\x65\x20"
|
"\x74\x73\x20\x65\x74\x20\x66\x61\x69\x72\x65\x20" \
|
||||||
"\x64\xe9\x66\x69\x6c\x65\x72\x20\x74\x65\x73\x20"
|
"\x64\xe9\x66\x69\x6c\x65\x72\x20\x74\x65\x73\x20" \
|
||||||
"\x73\x6c\x69\x64\x65\x73")
|
"\x73\x6c\x69\x64\x65\x73"
|
||||||
|
|
||||||
|
|
||||||
def blague():
|
def blague():
|
||||||
@ -68,10 +68,10 @@ def blague():
|
|||||||
Renvoie une blague aléatoire.
|
Renvoie une blague aléatoire.
|
||||||
"""
|
"""
|
||||||
return choice(
|
return choice(
|
||||||
["Je vais vous raconter une blague sur, mais vous "
|
["Je vais vous raconter une blague sur UDP, mais vous "
|
||||||
"ne l'aurez peut-être pas.",
|
"ne l'aurez peut-être pas.",
|
||||||
"Connaissez-vous la différence entre la théroie "
|
"Connaissez-vous la différence entre la théorie "
|
||||||
"et la pratique ? Il n'y en left pas, en théorie."])
|
"et la pratique ? Il n'y en a pas, en théorie."])
|
||||||
|
|
||||||
|
|
||||||
def calcul(left: int, right: int, res: int, operation='+'):
|
def calcul(left: int, right: int, res: int, operation='+'):
|
||||||
@ -79,19 +79,23 @@ def calcul(left: int, right: int, res: int, operation='+'):
|
|||||||
Vérifie si left operation b == c, où a, b et c sont des entiers.
|
Vérifie si left operation b == c, où a, b et c sont des entiers.
|
||||||
L'opération peut être +, -, *, /, &, |, ^, % ou l'un de ses alias anglais.
|
L'opération peut être +, -, *, /, &, |, ^, % ou l'un de ses alias anglais.
|
||||||
"""
|
"""
|
||||||
|
left = int(left)
|
||||||
|
right = int(right)
|
||||||
|
res = int(res)
|
||||||
|
|
||||||
if operation in ['+', 'add', 'sum']:
|
if operation in ['+', 'add', 'sum']:
|
||||||
result = left + right
|
result = left + right
|
||||||
if operation in ['-', 'sub']:
|
elif operation in ['-', 'sub']:
|
||||||
result = left - right
|
result = left - right
|
||||||
if operation in ['*', 'mul', 'prod']:
|
elif operation in ['*', 'mul', 'prod']:
|
||||||
result = left * right
|
result = left * right
|
||||||
if operation in ['/', 'div']:
|
elif operation in ['/', 'div']:
|
||||||
result = left / right
|
result = left / right
|
||||||
if operation in ['&', 'and']:
|
elif operation in ['&', 'and']:
|
||||||
result = left & right
|
result = left & right
|
||||||
if operation in ['|', 'or']:
|
elif operation in ['|', 'or']:
|
||||||
result = left | right
|
result = left | right
|
||||||
if operation in ['^', 'xor']:
|
elif operation in ['^', 'xor']:
|
||||||
result = left ^ right
|
result = left ^ right
|
||||||
else:
|
else:
|
||||||
result = left % right
|
result = left % right
|
||||||
@ -102,7 +106,7 @@ def tri(*args):
|
|||||||
"""
|
"""
|
||||||
Trie les éléments donnés en argument.
|
Trie les éléments donnés en argument.
|
||||||
"""
|
"""
|
||||||
return sorted(args)
|
return sorted(int(number) for number in args)
|
||||||
|
|
||||||
|
|
||||||
def stop(exit_code: int = 0):
|
def stop(exit_code: int = 0):
|
||||||
@ -113,5 +117,5 @@ def stop(exit_code: int = 0):
|
|||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__': # pragma: nocover
|
||||||
main()
|
main()
|
||||||
|
@ -77,9 +77,9 @@ class TestMain(unittest.TestCase):
|
|||||||
À partir d'une liste donnée, on trie la liste
|
À partir d'une liste donnée, on trie la liste
|
||||||
et on vérifie qu'elle est bien triée.
|
et on vérifie qu'elle est bien triée.
|
||||||
"""
|
"""
|
||||||
my_list = [23, 16, 234567, -4]
|
my_list = ["23", "16", "234567", "-4"]
|
||||||
shuffle(my_list)
|
shuffle(my_list)
|
||||||
sorted_list = sorted(my_list)
|
sorted_list = [-4, 16, 23, 234567]
|
||||||
self.assertEqual(main.commande("tri", *my_list), sorted_list)
|
self.assertEqual(main.commande("tri", *my_list), sorted_list)
|
||||||
|
|
||||||
def test_stop(self):
|
def test_stop(self):
|
||||||
|
132
slides/beamerthemecrans.sty
Normal file
132
slides/beamerthemecrans.sty
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%%%% BEAMER THEME FOR CRANS %%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% place in same folder as your .tex
|
||||||
|
% \usetheme{ens} in preamble
|
||||||
|
% also need crans-logo.png
|
||||||
|
|
||||||
|
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
|
||||||
|
\ProvidesPackage{ensbeamer}[2019/09/04 Beamer Theme]
|
||||||
|
\RequirePackage{tikz}
|
||||||
|
\RequirePackage{xcolor}
|
||||||
|
|
||||||
|
\makeatletter
|
||||||
|
\newif\if@section\@sectionfalse
|
||||||
|
\DeclareOption{sectiontitle}{
|
||||||
|
\@sectiontrue
|
||||||
|
}
|
||||||
|
|
||||||
|
\ProcessOptions\relax
|
||||||
|
|
||||||
|
\definecolor{rougecrans}{RGB}{207,14,34} % rougecrans !
|
||||||
|
|
||||||
|
\setbeamercolor{structure}{fg=rougecrans}
|
||||||
|
%\setbeamercolor{sidebar}{fg=rougecrans,bg=white}
|
||||||
|
\setbeamercolor{sidebar}{bg=white,fg=rougecrans}
|
||||||
|
%\setbeamercolor{title in sidebar}{fg=white}
|
||||||
|
%\setbeamercolor{section in sidebar}{fg=white}
|
||||||
|
\setbeamercolor{section in sidebar shaded}{fg=rougecrans!40}
|
||||||
|
\setbeamercolor{subsection in sidebar}{fg=rougecrans}
|
||||||
|
\setbeamercolor{subsection in sidebar shaded}{fg=rougecrans!60}
|
||||||
|
\setbeamercolor{frametitle}{fg=rougecrans,bg=white}
|
||||||
|
|
||||||
|
\def\swidth{2cm}
|
||||||
|
|
||||||
|
%
|
||||||
|
% -----------------------------
|
||||||
|
% Title Page
|
||||||
|
|
||||||
|
\setbeamerfont{title}{size=\huge}
|
||||||
|
\setbeamerfont{author}{size=\large}
|
||||||
|
\setbeamerfont{institut}{size=\Large}
|
||||||
|
\setbeamerfont{subtitle}{size=\Large}
|
||||||
|
\setbeamerfont{date}{size=\Large}
|
||||||
|
\setbeamertemplate{title page}{%
|
||||||
|
\begin{tikzpicture}[remember picture,overlay]
|
||||||
|
\fill[white]
|
||||||
|
(current page.north west) rectangle (current page.south east);
|
||||||
|
\node
|
||||||
|
at ([yshift=+.15\textheight]current page.center) (title)
|
||||||
|
{\usebeamerfont{title}\textcolor{rougecrans}{\inserttitle}};
|
||||||
|
|
||||||
|
\node[below=2em]
|
||||||
|
at(title) (subtitle)
|
||||||
|
{\usebeamerfont{subtitle}\textcolor{rougecrans}{\insertsubtitle}};
|
||||||
|
|
||||||
|
\node
|
||||||
|
at ([yshift=-70pt]current page.center) (institute)
|
||||||
|
{\usebeamerfont{institute}\textcolor{rougecrans}{\insertdate}};
|
||||||
|
|
||||||
|
\node
|
||||||
|
at ([yshift=-50pt]current page.center) (author)
|
||||||
|
{\usebeamerfont{author}\textcolor{rougecrans}{\insertauthor}};
|
||||||
|
|
||||||
|
\node [opacity=.15] at (current page.center) {\includegraphics[height=0.9\textheight]{crans-logo} };
|
||||||
|
|
||||||
|
\end{tikzpicture}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%
|
||||||
|
% --------------------------------------
|
||||||
|
% Sidebar
|
||||||
|
|
||||||
|
\useoutertheme[height=0pt,width=\swidth, hideothersubsections]{sidebar}
|
||||||
|
|
||||||
|
\setbeamertemplate{sidebar left}
|
||||||
|
{
|
||||||
|
{\vspace{0.9em}
|
||||||
|
\hspace{-0.4em}
|
||||||
|
\begin{minipage}{\swidth}
|
||||||
|
\centering
|
||||||
|
\insertlogo
|
||||||
|
\end{minipage}
|
||||||
|
\usebeamerfont{title in sidebar}%
|
||||||
|
\vskip1em%
|
||||||
|
\usebeamercolor[fg]{title in sidebar}%
|
||||||
|
\insertshorttitle[width=\swidth,center,respectlinebreaks]\par%
|
||||||
|
\vskip.5em%
|
||||||
|
}%
|
||||||
|
\insertverticalnavigation{\swidth}%
|
||||||
|
\vfill
|
||||||
|
\hbox to2cm{\hskip0.6cm\usebeamerfont{section in sidebar} \strut\usebeamercolor[fg]{section in sidebar}\insertframenumber/\inserttotalframenumber\hfill}%
|
||||||
|
\vskip3pt%
|
||||||
|
}%
|
||||||
|
|
||||||
|
|
||||||
|
% --------------------------------------------------------------------------
|
||||||
|
% Section as frame title
|
||||||
|
\if@section
|
||||||
|
\addtobeamertemplate{frametitle}{
|
||||||
|
\let\insertframetitle\insertsectionhead}{}
|
||||||
|
\addtobeamertemplate{frametitle}{
|
||||||
|
\let\insertframesubtitle\insertsubsectionhead}{}
|
||||||
|
|
||||||
|
\makeatletter
|
||||||
|
\CheckCommand*\beamer@checkframetitle{\@ifnextchar\bgroup\beamer@inlineframetitle{}}
|
||||||
|
\renewcommand*\beamer@checkframetitle{\global\let\beamer@frametitle\relax\@ifnextchar\bgroup\beamer@inlineframetitle{}}
|
||||||
|
|
||||||
|
\fi
|
||||||
|
|
||||||
|
\setbeamertemplate{caption}{\raggedright\insertcaption\par}
|
||||||
|
\setbeamertemplate{navigation symbols}[horizontal]
|
||||||
|
|
||||||
|
% ---------------------------------------------------
|
||||||
|
% BLOC
|
||||||
|
|
||||||
|
\setbeamertemplate{blocks}[rounded][shadow=false]
|
||||||
|
\setbeamercolor{block body}{fg=black,bg=rougecrans!20}
|
||||||
|
\setbeamercolor{block title}{fg=black,bg=rougecrans!40}
|
||||||
|
|
||||||
|
\setbeamercolor{block body example}{fg=black,bg=gray!40}
|
||||||
|
\setbeamercolor{block title example}{fg=black,bg=gray}
|
||||||
|
|
||||||
|
\setbeamercolor{block body alerted}{fg=black,bg=blue!40}
|
||||||
|
\setbeamercolor{block title alerted}{fg=black,bg=blue}
|
||||||
|
|
||||||
|
\setbeamercolor{subitem}{fg=rougecrans!20}
|
||||||
|
|
||||||
|
\makeatother
|
||||||
|
% LOGO :
|
||||||
|
\logo{\includegraphics[width=\swidth]{crans-logo.png}}
|
BIN
slides/crans-logo.png
Normal file
BIN
slides/crans-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
68
slides/seminaire-ci.tex
Normal file
68
slides/seminaire-ci.tex
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
\documentclass[handout,aspectratio=169]{beamer}
|
||||||
|
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage{lmodern}
|
||||||
|
\usepackage[francais]{babel}
|
||||||
|
\usepackage{graphicx}
|
||||||
|
|
||||||
|
\usetheme[sectiontitle]{crans}
|
||||||
|
|
||||||
|
\title{Automatisez vos tâches avec une intégration continue}
|
||||||
|
\subtitle{Séminaire CRANS}
|
||||||
|
\author[]{\textsc{Yohann D'ANELLO}}
|
||||||
|
\date{11 février 2021}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\begin{frame}
|
||||||
|
\maketitle
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}
|
||||||
|
\tableofcontents[subsubsectionstyle=hide]
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\section{Example}
|
||||||
|
|
||||||
|
\subsection{Block}
|
||||||
|
|
||||||
|
\begin{frame}
|
||||||
|
\begin{block}{Title block}
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||||
|
\end{block}
|
||||||
|
\begin{block}{}
|
||||||
|
No title Block \\
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||||
|
\end{block}
|
||||||
|
\begin{exampleblock}{Example Block}
|
||||||
|
Example text (ugly)
|
||||||
|
\end{exampleblock}
|
||||||
|
\begin{alertblock}{Alert Block}
|
||||||
|
Alert Text
|
||||||
|
\end{alertblock}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\subsection{Lists}
|
||||||
|
|
||||||
|
\begin{frame}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Item 1
|
||||||
|
\item Item 2
|
||||||
|
\begin{itemize}
|
||||||
|
\item Subitem 1
|
||||||
|
\item Subitem 2
|
||||||
|
\end{itemize}
|
||||||
|
\end{itemize}
|
||||||
|
\begin{enumerate}
|
||||||
|
\item item 1
|
||||||
|
\begin{enumerate}
|
||||||
|
\item item 1.1
|
||||||
|
\end{enumerate}
|
||||||
|
\item
|
||||||
|
\item
|
||||||
|
\item
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
\end{document}
|
Reference in New Issue
Block a user