From db51453de27cf1ec05d4858a68e4f7d2dcaeb1d4 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 26 Jan 2023 14:05:15 +0100 Subject: [PATCH] ci: add github workflow to build flake and run tests --- .github/workflows/build-flake.yml | 19 +++++++++++++++ .github/workflows/run-tests.yml | 39 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/build-flake.yml create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/build-flake.yml b/.github/workflows/build-flake.yml new file mode 100644 index 0000000..a0eaaab --- /dev/null +++ b/.github/workflows/build-flake.yml @@ -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 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..ed048f7 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -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