-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (66 loc) · 1.92 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This workflow builds and tests the project.
# It runs for every pull request.
# For testing currently uses the tests in Nillion repo.
name: Build
on:
push:
branches: "**"
pull_request:
branches: "**"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.24"
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Lint with pylint
run: |
uv run pylint nada_dsl/
- name: Test with pytest
run: |
uv run pytest
# Test that the compiled programs are compatible the Nillion backend.
test:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Generate Nillion Repo app token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.NILLION_REPO_APP_ID }}
private-key: ${{ secrets.NILLION_REPO_PRIVATE_KEY }}
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: NillionNetwork/nillion
path: nillion
token: ${{ steps.generate-token.outputs.token }}
- name: Replace nillion's nada_dsl with this version
uses: actions/checkout@v4
with:
path: nillion/nada-lang/nada_dsl
- name: Check that test-programs compile
run: |
pip install -U virtualenv
cd nillion && cargo build -p test-programs
- name: Run nada autotests
run: |
pip install nillion/nada-lang/nada_dsl
mkdir target
cd nillion
RUST_LOG=warn cargo run -p auto-tests