-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (101 loc) · 3.68 KB
/
build-n-test.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
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
111
112
113
114
115
116
117
118
119
120
121
# This is a basic workflow to Build and Test using Github Actions
name: Build & Test
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-n-test:
runs-on: ubuntu-latest
steps:
- name: Checkout slack_handler
uses: actions/checkout@v2
with:
path: 'slack_handler'
- name: Checkout pytsk
uses: actions/checkout@v2
with:
repository: 'py4n6/pytsk'
path: 'pytsk'
- name: Checkout libewf
uses: actions/checkout@v2
with:
repository: 'libyal/libewf'
path: 'libewf'
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install pipenv
run: |
python3 -m pip install --upgrade pipenv wheel
- name: Cache it out
id: cache-pipenv
uses: actions/cache@v2
with:
path: |
~/.local/share/virtualenvs
./pytsk/build/
./libewf/build/
key: ${{ runner.os }}-pipenv-${{ hashFiles('slack_handler/Pipfile.lock') }}-${{ hashFiles('pytsk/version.txt') }}-${{ hashFiles('libewf/ChangLog') }}
restore-keys: |
${{ runner.os }}-pipenv---
- name: Run pipenv
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd slack_handler
pipenv install --dev --deploy
- name: Install build dependencies for pytsk
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: sudo apt-get install automake autotools-dev build-essential git libtool python3 python3-dev python3-distutils python3-setuptools
- name: Update pytsk
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd pytsk
python3 setup.py update
- name: Build pytsk
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd pytsk
python3 setup.py build
- name: Install pytsk
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd slack_handler/
pipenv run pip install ../pytsk/
- name: Install dependencies for libewf
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: sudo apt-get install build-essential debhelper fakeroot autotools-dev flex bison zlib1g-dev libbz2-dev libssl-dev libfuse-dev python-dev python-setuptools python3-dev python3-setuptools
- name: Sync libs and build libewf
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd libewf
./synclibs.sh
./autogen.sh
./configure --enable-python3
python3 setup.py build
- name: Install libewf
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
cd slack_handler/
pipenv run pip install ../libewf/
- name: Check needed modules
run: |
cd slack_handler/
pipenv run pip list
pipenv run pip list | grep pytsk
pipenv run pip list | grep libewf
pipenv run pip list | grep pytest
- name: Install Slack_handler
run: |
cd slack_handler/
pipenv run pip install --no-deps -e .
- name: Run all tests
run: |
cd slack_handler/
pipenv run pytest --verbose