Skip to content

Commit b29b1b1

Browse files
Add workflows file for running tests on datasets
Added a YAML file to run GitHub Actions test suite on the datasets in the repository. The YAML file checks out the repository that handles the generation and representation of the causal contextuality scenarios (and more) and runs a test suite with PySpark and Pytest on the datasets in this repository.
1 parent be24c11 commit b29b1b1

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Validate datasets
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
validate-datasets:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 120
15+
16+
steps:
17+
- name: Checkout dataset repository
18+
uses: actions/checkout@v4
19+
with:
20+
path: datasets
21+
22+
- name: Checkout Quantum Experiment Structures
23+
uses: actions/checkout@v4
24+
with:
25+
repository: MarkusBolinder/quantum-experiment-structures
26+
path: quantum-experiment-structures
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
33+
# Spark requires Java
34+
- name: Set up Java
35+
uses: actions/setup-java@v4
36+
with:
37+
distribution: temurin
38+
java-version: "17"
39+
40+
- name: Install Quantum Experiment Structures
41+
working-directory: quantum-experiment-structures
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install -e ".[dev]"
45+
46+
- name: Verify Spark installation
47+
run: |
48+
python -c "from pyspark.sql import SparkSession; \
49+
spark=SparkSession.builder.master('local[2]').appName('test').getOrCreate(); \
50+
print(spark.range(10).count()); \
51+
spark.stop()"
52+
53+
- name: Run ensemble dataset tests
54+
env:
55+
QES_DATA_ROOT: ${{ github.workspace }}/datasets
56+
working-directory: quantum-experiment-structures
57+
run: |
58+
pytest unittests/end_to_end_test.py -v

0 commit comments

Comments
 (0)