forked from OI-wiki/OI-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.26 KB
/
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
name: Check example code
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: OI-wiki Offline Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed code files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
docs/**/*.cpp
- uses: actions/setup-python@v4
if: steps.changed-files.outputs.any_changed == 'true'
with:
python-version: '3.10'
cache: pipenv
- name: Install Python dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: |
curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python3
pipenv install
- name: Install C++
if: steps.changed-files.outputs.any_changed == 'true'
run: sudo apt-get install -y g++
- name: Make the File list
if: steps.changed-files.outputs.any_changed == 'true'
run: echo "${{ steps.changed-files.outputs.all_changed_files }}" > res.txt
- name: Check the Code
if: steps.changed-files.outputs.any_changed == 'true'
run: pipenv run python scripts/test.py