Skip to content

Atualizações do CI (#25) #67

Atualizações do CI (#25)

Atualizações do CI (#25) #67

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
branchs:
- 'feature/**'
- 'hotfix/**'
- 'release/**'
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Instala nix single user
run: |
BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \
&& SHA256=87fa0f1dbfdd28a1f99b39d5bd4dcc39de97bc64 \
&& NIX_RELEASE_VERSION='2.10.2' \
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \
&& . ~/."$(basename $SHELL)"rc \
&& export TMPDIR=/tmp \
&& nix flake --version \
&& nix registry pin nixpkgs github:NixOS/nixpkgs/ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
nix develop .# --command sh -c 'make poetry.install'
- name: Lint code with black
run: |
nix develop .# --command sh -c 'source .venv/bin/activate && make fmt.check'
test:
name: test [${{ matrix.os }}] (${{ matrix.python }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python: [3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Instala nix single user
run: |
BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \
&& SHA256=87fa0f1dbfdd28a1f99b39d5bd4dcc39de97bc64 \
&& NIX_RELEASE_VERSION='2.10.2' \
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \
&& . ~/."$(basename $SHELL)"rc \
&& export TMPDIR=/tmp \
&& nix flake --version \
&& nix registry pin nixpkgs github:NixOS/nixpkgs/ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
nix develop .# --command sh -c 'make poetry.install'
- name: Test with pytest
run: nix develop .# --command sh -c 'source .venv/bin/activate && make test'
coverage:
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v4
- name: Instala nix single user
run: |
BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \
&& SHA256=87fa0f1dbfdd28a1f99b39d5bd4dcc39de97bc64 \
&& NIX_RELEASE_VERSION='2.10.2' \
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \
&& . ~/."$(basename $SHELL)"rc \
&& export TMPDIR=/tmp \
&& nix flake --version \
&& nix registry pin nixpkgs github:NixOS/nixpkgs/ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
nix develop .# --command sh -c 'make poetry.install'
- name: make coverage
run: nix develop .# --command sh -c 'source .venv/bin/activate && make coverage'
- uses: codecov/codecov-action@v4
with:
file: ./coverage.xml # optional