ci: add github workflow to build flake and run tests

This commit is contained in:
Pierre Bourdon
2023-01-26 14:05:15 +01:00
parent 49d4e9e98d
commit db51453de2
2 changed files with 58 additions and 0 deletions

19
.github/workflows/build-flake.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Build Nix Flake
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
build-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v15
- run: nix build

39
.github/workflows/run-tests.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Run tests
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
with:
version: 1.3.0
virtualenvs-create: true
- name: Install dependencies
run: |
poetry -C fifoci/runner install --no-interaction --no-root
poetry -C fifoci/frontend install --no-interaction --no-root
- name: Check runner coding style
run: poetry run -C fifoci/runner black --check fifoci/runner
- name: Check frontend coding style
run: poetry run -C fifoci/frontend black --check fifoci/frontend
- name: Run frontend unit tests
run: poetry run -C fifoci/frontend fifoci-frontend-manage test --noinput