-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (56 loc) · 1.94 KB
/
main.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
---
name: Build
on:
repository_dispatch:
types: [run_test_suite]
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ubuntu-latest
env:
ms_suite: omero-ms-zarr-suite
bf_suite: ome-zarr-bf2raw-suite
zarr_suite: ome-zarr-py-suite
steps:
- uses: actions/checkout@v2
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,ome
environment-file: environment.yml
python-version: 3.9
- name: Set testing environment
if: github.event.action == 'run_test_suite'
shell: bash
run: |
# Set the parameters to be used in the response
repo=${{ github.event.client_payload.repo }}
owner=${{ github.event.client_payload.owner }}
sha=${{ github.event.client_payload.sha }}
repo_name=${repo#"$owner"}
repo_name=${repo_name#"/"}
echo "client_repo_name="$repo_name >> $GITHUB_ENV
echo "client_sha="$sha >> $GITHUB_ENV
./setup.sh $repo
- name: Run pytest
shell: bash -l {0}
run: pytest -vxk "not omero"
# yamllint disable rule:line-length
- name: Create issue
if: failure() && github.event.action == 'run_test_suite'
run: |
curl -X "POST" "https://api.github.com/repos/ome/${{env.client_repo_name}}/issues?state=all" \
-H "Cookie: logged_in=no" \
-H "Authorization: token ${{secrets.ACTION_API_TOKEN}}" \
-H "Content-Type: text/plain; charset=utf-8" \
-d $'{
"title": "Test suite failure for commit ${{env.client_sha}}",
"body": "Test suite status: ${{ job.status }} see https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"labels": [
"bug"
]
}'