Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: Python Workflow with GH Actions
- on: [push]
- jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python 3.9
- uses: actions/setup-python@v1
- with:
- python-version: 3.9
- - name: Install dependencies
- run: |
- make install
- - name: Lint with Pylint
- run: |
- make lint
- - name: Test with Pytest
- run: |
- make test
- - name: Format code with Python black
- run: |
- make format
- ********************
- CI = Continuous Integration
- Uma técnica para automação do fundamental do processo de desenvolvimento: garantia de requisitos de funcionamento, verificação sintática e testes.
- "Automação de testes"
- CI cloud-based
- multi-cloud CI
- provider cloud = Cloud9 @ EC2 @ AWS
- "build server" = GitHub Actions
- CD = Continuous Delivery
- Pretende garantir que o código está num estado utilizável (tipicamente o ramo principal, assumindo que essa produção se destina aos utilizadores finais).
- Mas pode haver CD para outros ramos.
- CD = produção@CI ---> build env ---> resultado ---> deployment
- AWS ---> Cloud Shell (Bash+Editor)
- GCP ---> Cloud Shell (Bash+Editor) ---> gcloud app deploy
- Azure ---> Cloud Shell (Bash+Editor)
- mkdir <nome da pasta>
- rmdir <nome da pasta> --ignore-fail-on-non-empty
- ls -l -a -h
- ls -lah
- assert(expressão-booleana)
- se a exp é False, causa uma runtime exception
- Para testar diretamente em ambientes bash podemos fazer
- python3 -m pytest <nome do ficheiro>
- a utilização de assert é fundamental nalguns padrões de teste.
- push ---> upload
- pull --> fetch + merge --> download
- git push <repo por defeito> <ramo corrente>
- git push origin master
- #move/rename master to main (Azure)
- git branch -M main master
- python3 -m venv venv
- make install
- Automatizar: requirements, linting, testing, via um "build server" noutra Coud.
- Isso significa fazer "multi-cloud Continuous Integration".
- Vamos usar o "build server" "GitHub Actions".
- Este programa configura-se por um ficheiro .yaml (Yet Another Markup Language)
- my_wf_for_mc_ci = "my work"
Add Comment
Please, Sign In to add comment