-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (94 loc) · 3.24 KB
/
Copy pathVALIDATION.yml
File metadata and controls
117 lines (94 loc) · 3.24 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
name: Pull Request Label Validation
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
check-label:
runs-on: ubuntu-latest
steps:
- name: Wait if no or multiple labels exists
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const labels = pr.data.labels
.map(l => l.name)
.filter(l => ["feature", "patch", "build"].includes(l));
if (labels.length !== 1) {
console.log("No or multiple labels exists! Waiting");
return "wait";
}
return "continue";
- name: Delayed execution
if: steps.check.outputs.result == 'wait'
run: sleep 30
- name: Check labels
uses: actions/github-script@v7
with:
script: |
const run = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
// Get PR number from workflow run
const pr_number = run.data.pull_requests[0]?.number;
if (!pr_number) {
core.setFailed('Could not find associated pull request');
return;
}
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr_number
});
const labels = pr.data.labels
.map(l => l.name)
.filter(l =>
["feature","patch","build","major"].includes(l)
);
if (labels.length === 0) {
core.setFailed(
`PR does not contain any version labels, it must contain exactly one of the following labels - major, feature, patch, build`
);
} else if (labels.length > 1) {
core.setFailed(
`PR contains multiple version labels, it must contain exactly one of the following labels - major, feature, patch, build. Found: ${labels.join(", ")}`
);
}
build:
needs: check-label
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: test-env
init-shell: bash
- name: Test conda installation
shell: bash -l {0}
run: |
micromamba install conda --yes
conda config --set channel_priority strict
# install package from repo
pip install .
- name: Verify package imports
shell: bash -l {0}
run: |
mmaseq --version
- name: Test pipeline
shell: bash -l {0}
run: |
mmadeploy --deploy_dir ~/test --threads 3 --test --verbosity 2