-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (87 loc) · 2.51 KB
/
Copy pathci.yml
File metadata and controls
110 lines (87 loc) · 2.51 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- name: Build
run: cargo build --verbose
- name: Upload dapper binary
uses: actions/upload-artifact@v7
with:
name: dapper-binary-${{ runner.os }}
path: |
target/debug/dapper${{ matrix.os == 'windows-latest' && '.exe' || '' }}
- name: Run tests
run: cargo test --verbose
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Run Clippy
run: |
cargo clippy --version
cargo clippy -- -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check formatting
run: |
cargo fmt --version
cargo fmt -- --check
python-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[test]
working-directory: python
- name: Run pytest
run: python -m pytest
working-directory: python
fetching-dataset-test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v7
- name: Download dapper dataset
uses: actions/download-artifact@v8
with:
name: dapper-binary-${{ runner.os }}
path: target/debug/
- name: Make binary executable
run: chmod +x target/debug/dapper
- name: Download and Extract dataset
env:
#Points at file for the current branch/PR, if this doesn't work we could also try relative filepath
DAPPER_DATASET_MANIFEST: https://raw.githubusercontent.com/LLNL/dapper/${{ github.ref }}/docs/dataset_list.toml
run: |
# Initializing XDG directory
mkdir -p $HOME/.local/share/dapper
# Download Linux package database
./target/debug/dapper db install ubuntu-jammy
# Download PyPI package database
./target/debug/dapper db install pypi
- name: Test Dapper with downloaded artifact
run: |
mkdir -p /tmp/test-files
echo '#include <iostream>' > /tmp/test-files/test.cpp
./target/debug/dapper /tmp/test-files