ci: Use nix for quality test workflow #542
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: Code formatting quality and testing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
pull_request_review: | |
types: | |
- submitted | |
jobs: | |
Format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install nix | |
run: sudo sh <(curl -L https://nixos.org/nix/install) --daemon --yes | |
- name: Run clang-format | |
run: nix-shell --run 'make format-dry-run' | |
Tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install nix | |
run: sudo sh <(curl -L https://nixos.org/nix/install) --daemon --yes | |
- name: Run clang-tidy | |
run: nix-shell --run 'make tidy' | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install nix | |
run: sudo sh <(curl -L https://nixos.org/nix/install) --daemon --yes | |
- name: Build debug executable | |
run: nix-shell --run 'CXX=clang++ make build GCOV=1' | |
- name: Run tests_runner | |
run: nix-shell --run 'make coverage' | |
- name: "Upload coverage report" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage-report | |
path: compiler/tests/reports | |
retention-days: 5 |