Repository navigation
134 lines (125 loc) · 4.38 KB
/
Copy pathpython_linux.yml
File metadata and controls
134 lines (125 loc) · 4.38 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Python On Linux
on:
workflow_call:
inputs:
runner:
description: 'The type of runner to use for this job'
type: string
required: false
default: 'ubuntu-latest'
jobs_to_run:
description: 'Controls which jobs to run. "all" runs everything.'
type: string
required: false
default: 'all'
jobs:
python_linux:
if: ${{ inputs.jobs_to_run == 'all' }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
app:
- name: flask-secret
path: flask-secret
script_dir: flask-secret
config:
- job: record_latest_replay_build
record_src: latest
replay_src: build
- job: record_build_replay_latest
record_src: build
replay_src: latest
- job: record_build_replay_build
record_src: build
replay_src: build
name: ${{ matrix.app.name }} (${{ matrix.config.job }})
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: keploy/keploy
- name: Install Python
uses: deadsnakes/action@v3.2.0
with:
python-version: "3.11"
- id: record
uses: ./.github/actions/download-binary
with:
src: ${{ matrix.config.record_src }}
- id: replay
uses: ./.github/actions/download-binary
with:
src: ${{ matrix.config.replay_src }}
- name: Checkout the samples-python repository
uses: actions/checkout@v4
with:
repository: keploy/samples-python
path: samples-python
- name: Run the ${{ matrix.app.name }} application
env:
RECORD_BIN: ${{ steps.record.outputs.path }}
REPLAY_BIN: ${{ steps.replay.outputs.path }}
run: |
cd samples-python/${{ matrix.app.path }}
source $GITHUB_WORKSPACE/.github/workflows/test_workflow_scripts/python/${{ matrix.app.script_dir }}/python-linux.sh
python_linux_private:
if: ${{ (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
app:
- name: django-postgres
path: django-postgres/django_postgres
script_dir: django_postgres
config:
- job: record_latest_replay_build
record_src: latest
replay_src: build
- job: record_build_replay_latest
record_src: build
replay_src: latest
- job: record_build_replay_build
record_src: build
replay_src: build
name: ${{ matrix.app.name }} (${{ matrix.config.job }})
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: keploy/keploy
- name: Install Python
uses: deadsnakes/action@v3.2.0
with:
python-version: "3.11"
- name: Setup docker-compose
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.33.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
- name: Install necessary dependencies
run: |
sudo apt-get install -y build-essential gcc python3-dev libpq-dev pkg-config
- id: record
uses: ./.github/actions/download-binary
with:
src: ${{ matrix.config.record_src }}
- id: replay
uses: ./.github/actions/download-binary
with:
src: ${{ matrix.config.replay_src }}
- name: Checkout the samples-python repository
uses: actions/checkout@v4
with:
repository: keploy/samples-python
path: samples-python
- name: Run the ${{ matrix.app.name }} application
env:
RECORD_BIN: ${{ steps.record.outputs.path }}
REPLAY_BIN: ${{ steps.replay.outputs.path }}
run: |
cd samples-python/${{ matrix.app.path }}
source $GITHUB_WORKSPACE/.github/workflows/test_workflow_scripts/python/${{ matrix.app.script_dir }}/python-linux.sh