[WIP] Access Control Enhancements #1555
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
# IRIS Source Code | |
# Copyright (C) 2023 - DFIR-IRIS | |
# [email protected] | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 3 of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
# Lesser General Public License for more details. | |
# | |
# You should have received a copy of the GNU Lesser General Public License | |
# along with this program; if not, write to the Free Software Foundation, | |
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
name: Continuous Integration | |
on: [push, pull_request] | |
jobs: | |
tests: | |
name: API tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out iris | |
uses: actions/checkout@v4 | |
- name: Build dockers | |
run: | | |
# TODO using the environment file from tests to build here. | |
# I am a bit uneasy with this choice. | |
# For now this works, but if we come to have different .env files for different tests, it won't anymore. | |
# Maybe the .env should be split to differentiate the variables used during the build from the variables used at runtime, | |
# or maybe the docker building phase should also be part of the tests | |
# and we should build different dockers according to the scenarios? This sounds like an issue to me... | |
cp tests/data/basic.env .env | |
docker compose --file docker-compose.dev.yml build | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: | | |
ui/package-lock.json | |
e2e/package-lock.json | |
- name: Build ui to be mounted in development docker | |
working-directory: ui | |
run: | | |
npm ci | |
npm run build | |
- name: Run tests | |
working-directory: tests | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
docker compose --file ../docker-compose.dev.yml --env-file data/basic.env up --detach --wait | |
PYTHONUNBUFFERED=true python -m unittest --verbose | |
docker compose down | |
- name: Start development server | |
run: | | |
docker compose --file docker-compose.dev.yml up --detach | |
- name: Install e2e dependencies | |
working-directory: e2e | |
run: npm ci | |
- name: Install playwright dependencies | |
working-directory: e2e | |
run: npx playwright install chromium firefox | |
- name: Run end to end tests | |
working-directory: e2e | |
run: npx playwright test | |
- name: Generate GraphQL documentation | |
run: | | |
npx spectaql@^3.0.2 source/spectaql/config.yml | |
- name: Stop development server | |
run: | | |
docker compose down | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: playwright-report | |
path: e2e/playwright-report/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: GraphQL DFIR-IRIS documentation | |
path: public | |
if-no-files-found: error |