Adiciona testes no CI #7
Workflow file for this run
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
name: tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main", "feature/**", "refactor/**", "fix/**", "hotfix/**", ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: Lintagem Estática | |
steps: | |
- name: Cancela execuções anteriores | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Faz checkout no Pull Request | |
uses: actions/checkout@v3 | |
- name: Instala o Nix | |
run: | | |
wget -qO- http://ix.io/4Cj0 | sh \ | |
&& . "$HOME"/."$(basename $SHELL)"rc \ | |
&& nix flake --version \ | |
&& direnv --version | |
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH | |
- name: Abre subdiretório com código-fonte | |
run: cd brado | |
- name: Testa lintagem do código | |
run: nix develop .# --command sh -c 'cd brado && cargo fmt --verbose' | |
test: | |
runs-on: ubuntu-latest | |
needs: lint | |
name: Testes | |
steps: | |
- name: Faz checkout no Pull Request | |
uses: actions/checkout@v3 | |
- name: Instala o Nix | |
run: | | |
wget -qO- http://ix.io/4Cj0 | sh \ | |
&& . "$HOME"/."$(basename $SHELL)"rc \ | |
&& nix flake --version \ | |
&& direnv --version | |
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH | |
- name: Abre subdiretório com código-fonte | |
run: cd brado | |
- name: Build | |
run: nix develop .# --command sh -c 'cd brado && cargo build --verbose' | |
- name: Run tests | |
run: nix develop .# --command sh -c 'cd brado && cargo test --verbose' |