-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (98 loc) · 3.75 KB
/
test-versions.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
# This is a basic workflow to help you get started with Actions
# github.event_name can be used to get the name of the event that started the workflow
name: Test Versions
on:
push:
branches:
- main
paths:
- "ppl_meshexport_addon/**"
- ".github/workflows/**"
workflow_run:
workflows: ["Publish Release"]
branches: [main]
types:
- completed
jobs:
test:
runs-on: 'ubuntu-latest'
permissions: read-all
strategy:
max-parallel: 4
matrix:
blender-version: ["2.90", "2.80", "2.79"]
steps:
- name: Install Blender
run: |
if [ "${{ matrix.blender-version}}" = "2.79" ]; then
sudo apt-get update
sudo apt-get install libglu1
fi
sudo snap install blender --channel=${{ matrix.blender-version }} --classic
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
#Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install add-on
run: |
mkdir $GITHUB_WORKSPACE/tempmodulefolder
cp -R $GITHUB_WORKSPACE/ppl_meshexport_addon $GITHUB_WORKSPACE/tempmodulefolder/ppl_meshexport_addon
- name: Test Add-on on version ${{ matrix.blender-version }}
run: |
sudo apt-get install lua5.3
python $GITHUB_WORKSPACE/.github/workflows/blender_tests/blender_test_wrapper.py
- name: Upload test results
uses: actions/upload-artifact@v2.2.4
with:
name: test-results-blender-v${{ matrix.blender-version }}
path: ${{ github.workspace }}/.github/workflows/blender_tests/test_results.json
retention-days: 1
posttest:
runs-on: 'ubuntu-latest'
needs: test
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v2.3
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.9.6'
- uses: actions/download-artifact@v2.0.10
with:
path: artifacts
- name: Process Results
run: |
python $GITHUB_WORKSPACE/.github/workflows/post_test/generate_table.py
- name: Reply to commit
if: ${{ github.event_name == 'push' }}
uses: actions/github-script@v4
with:
script: |
const fs = require('fs')
const path = require('path')
const path_to_tables = path.join(process.env.GITHUB_WORKSPACE, ".github", "workflows", "post_test")
let textBody = "Hi there! Here's some automated test results for your commit:\n";
textBody += fs.readFileSync(path.join(path_to_tables, "results_table.txt"), "utf8")
textBody += "\n\nAny errors produced during tests will be displayed below:\n"
textBody += fs.readFileSync(path.join(path_to_tables, "traceback_table.txt"), "utf8")
await github.repos.createCommitComment({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha,
body: textBody
})
- name: Update README
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'update-readme') || github.event_name == 'workflow_run' }}
run: |
python $GITHUB_WORKSPACE/.github/workflows/post_test/update_readme.py
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Automatically updated README.md with new test results."
git push origin main