Skip to content

Project foundation

Project foundation #7

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
backend-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Nix update
run: |
# Update nix
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
- name: Load Nix shell
working-directory: ./apps/EnergyAnalyzer
run: nix-shell ../../shell.nix --run "echo 'Loading dev env'"
- name: Run unit tests
working-directory: ./apps/EnergyAnalyzer
run: |
nix-shell ../../shell.nix --run "just test"
coverageFilePath=$(find ./TestResults -name 'coverage.cobertura.xml')
echo "coverageFilePath=$coverageFilePath" >> $GITHUB_ENV
- uses: dennisjensen95/[email protected]
with:
coverage-filepath: ${{ env.coverageFilePath }}
branch: main
threshold-total: 90
threshold-change: 80