-
Notifications
You must be signed in to change notification settings - Fork 15
123 lines (118 loc) · 4.53 KB
/
run_tests.yaml
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
name: Run tests
# This GitHub Actions workflow is designed to automate testing for the project.
# It triggers under two conditions:
# 1. Pull requests targeting the main branch, ensuring that internal changes
# are validated before merging.
# 2. Pushes to the dev branch, allowing for continuous integration
# as changes are made directly to the development branch.
#
# The workflow consists of three main jobs:
# - **test-tools**: Runs tests for tools extracted from the repository.
# - **test-tutorials**: Runs tests for community tutorials.
# - **test-workflows**: Runs tests for workflow scripts.
#
# Each job includes the following steps:
# - Checkout the repository code.
# - Set up the Python environment using the specified version.
# - Install required dependencies.
# - Execute scripts for extraction and filtering of tools, tutorials, or workflows.
#
# This ensures that the code remains reliable and functional as new changes are introduced.
on:
pull_request:
branches:
- main # Trigger on pull requests targeting the main branch
push:
branches:
- dev # Trigger on pushes to the dev branch
jobs:
test-tools:
runs-on: ubuntu-20.04
# This job runs tests for tools.
# It checks for internal pull requests targeting the main branch,
# as well as pushes to the dev branch.
# The workflow performs the following steps:
# 1. Checkout the repository code.
# 2. Set up Python environment using the specified version.
# 3. Install required Python packages.
# 4. Extract tools using a provided script.
# 5. Filter community tools using a provided script.
# 6. Format tools into an interactive table and generate a word cloud.
if: github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/dev'
strategy:
matrix:
python-version: ['3.11']
environment: fetch-tools
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Tool extraction
run: |
bash sources/bin/extract_all_tools.sh test
env:
GITHUB_API_KEY: ${{ secrets.GH_API_TOKEN }}
- name: Tool filter
run: |
bash sources/bin/get_community_tools.sh test
- name: Create interactive table and wordcloud
run: |
bash sources/bin/format_tools.sh test
test-tutorials:
runs-on: ubuntu-20.04
# This job runs tests for tutorials.
# Similar to the tools job, it checks for internal pull requests
# to the main branch and pushes to the dev branch.
# The workflow performs the following steps:
# 1. Checkout the repository code.
# 2. Set up Python environment using the specified version.
# 3. Install required Python packages.
# 4. Extract tutorials using a provided script.
# 5. Filter community tutorials using a provided script.
if: github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/dev'
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Tutorial extraction
run: |
bash sources/bin/extract_all_tutorials.sh test
env:
PLAUSIBLE_API_KEY: ${{ secrets.PLAUSIBLE_API_TOKEN }}
- name: Tutorial filtering
run: |
bash sources/bin/get_community_tutorials.sh test
test-workflows:
runs-on: ubuntu-20.04
# This job runs tests for workflows.
# It performs the same checks as the other jobs, ensuring
# quality for workflow scripts.
if: github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/dev'
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Workflow extraction
run: |
bash sources/bin/extract_all_workflows.sh test
- name: Workflow filtering
run: |
bash sources/bin/get_community_workflows.sh test