Repository navigation
84 lines (77 loc) · 2.87 KB
/
Copy pathverify.yml
File metadata and controls
84 lines (77 loc) · 2.87 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
name: verify
on:
push:
branches: [main]
paths-ignore:
- "**/*.md"
pull_request:
paths-ignore:
- "**/*.md"
permissions:
contents: read
jobs:
affected:
runs-on: ubuntu-latest
outputs:
# Pushes to main always run all test suites; PRs run only affected suites.
discojs: ${{ github.event_name == 'push' || steps.select.outputs.discojs == 'true' }}
discojs_node: ${{ github.event_name == 'push' || steps.select.outputs.discojs_node == 'true' }}
discojs_web: ${{ github.event_name == 'push' || steps.select.outputs.discojs_web == 'true' }}
server: ${{ github.event_name == 'push' || steps.select.outputs.server == 'true' }}
server_docker: ${{ github.event_name == 'push' || steps.select.outputs.server_docker == 'true' }}
webapp: ${{ github.event_name == 'push' || steps.select.outputs.webapp == 'true' }}
cli: ${{ github.event_name == 'push' || steps.select.outputs.cli == 'true' }}
docs_examples: ${{ github.event_name == 'push' || steps.select.outputs.docs_examples == 'true' }}
steps:
- uses: actions/checkout@v7
with:
# PR checkouts use a synthetic merge commit; depth 2 includes its base parent.
fetch-depth: 2
- id: select
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
token: ""
filters: .github/ci-paths.yml
download-datasets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/download-datasets
static-analysis:
uses: ./.github/workflows/_static-analysis.yml
build:
needs: [static-analysis]
uses: ./.github/workflows/_build.yml
test-docker:
needs: [affected]
if: needs.affected.outputs.server_docker == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
load: true
tags: server-test
- run: |
docker run --detach --publish 8080:8080 server-test
timeout=120
while ! curl http://localhost:8080
do
[ $timeout -eq 0 ] && exit 1
sleep 1
timeout=$((timeout - 1))
done
test:
needs: [affected, download-datasets, build]
uses: ./.github/workflows/_test.yml
with:
discojs: ${{ needs.affected.outputs.discojs == 'true' }}
discojs_node: ${{ needs.affected.outputs.discojs_node == 'true' }}
discojs_web: ${{ needs.affected.outputs.discojs_web == 'true' }}
server: ${{ needs.affected.outputs.server == 'true' }}
webapp: ${{ needs.affected.outputs.webapp == 'true' }}
cli: ${{ needs.affected.outputs.cli == 'true' }}
docs_examples: ${{ needs.affected.outputs.docs_examples == 'true' }}