-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (144 loc) · 5.54 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
name: Run tests
run-name: "${{ inputs.name }}: ${{ toJSON(inputs) }}"
on:
workflow_dispatch:
inputs:
name:
description: 'Name'
required: true
type: string
default: 'Run tests'
os:
description: 'Runs on'
required: false
type: string
default: 'ubuntu-22.04 macos-14 windows-2022'
targets:
description: 'Test targets'
required: false
type: string
default: 'core swig-py swig-pl swig-rb javahl'
subversion:
description: 'Subversion (owner/repo@ref | version | URL-to-tarball)'
required: true
default: 'apache/subversion@trunk'
dependencies:
required: true
default: 'swig=3.0.12 py3c=v1.4 apr=1.7.5 apr-util=1.6.3 httpd=2.4.62 serf=1.3.10 junit=4.13.2'
jobs:
setup:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
ubuntu: ${{ steps.convert.outputs.ubuntu }}
macos: ${{ steps.convert.outputs.macos }}
windows: ${{ steps.convert.outputs.windows }}
targets: ${{ steps.convert.outputs.targets }}
subversion: ${{ steps.convert.outputs.subversion }}
dependencies: ${{ steps.convert.outputs.dependencies }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Convert inputs to json outputs
id: convert
env:
INPUTS: ${{ toJSON(inputs) }}
run: ./convert.sh
- name: Cache Subversion archives
if: ${{ steps.convert.outputs.subversion &&
fromJson(steps.convert.outputs.subversion).archive }}
uses: actions/cache@v4
with:
path: arc
enableCrossOsArchive: true
key: arc-svn-${{ fromJson(steps.convert.outputs.subversion).archive }}
restore-keys: |
arc-svn-${{ fromJson(steps.convert.outputs.subversion).archive }}
arc-svn-
- name: Cache SWIG archives
if: ${{ contains(fromJson(steps.convert.outputs.targets), 'swig-pl') ||
contains(fromJson(steps.convert.outputs.targets), 'swig-py') ||
contains(fromJson(steps.convert.outputs.targets), 'swig-rb') }}
uses: actions/cache@v4
with:
path: arc
enableCrossOsArchive: true
key: arc-swig-${{ fromJson(steps.convert.outputs.dependencies).swig }}
restore-keys: |
arc-swig-${{ fromJson(steps.convert.outputs.dependencies).swig }}
arc-swig-
- name: Cache junit jar file
if: ${{ contains(fromJson(steps.convert.outputs.targets), 'javahl') }}
uses: actions/cache@v4
with:
path: arc
enableCrossOsArchive: true
key: arc-junit-${{ fromJson(steps.convert.outputs.dependencies).junit }}
restore-keys: |
arc-junit-${{ fromJson(steps.convert.outputs.dependencies).junit }}
arc-junit-
- name: Download Subversion archives
if: ${{ steps.convert.outputs.subversion &&
fromJson(steps.convert.outputs.subversion).archive }}
env:
SVNARC: ${{ fromJson(steps.convert.outputs.subversion).archive }}
SVNARC_NETRC: ${{ secrets.SVNARC_NETRC }}
run: |
set -ex
/bin/sh -c 'data="$SVNARC_NETRC"; test -n "$data" && echo -n "$data" | base64 -d - >"$HOME/.netrc"'
test -d arc || mkdir arc
wget -nv -N -P arc "$SVNARC" "${SVNARC%.tar.bz2}.zip"
rm -rf "$HOME/.netrc"
- name: Download SWIG archives
if: ${{ contains(fromJson(steps.convert.outputs.targets), 'swig-pl') ||
contains(fromJson(steps.convert.outputs.targets), 'swig-py') ||
contains(fromJson(steps.convert.outputs.targets), 'swig-rb') }}
env:
SWIG_VER: ${{ fromJson(steps.convert.outputs.dependencies).swig }}
run: |
set -ex
prefix='https://prdownloads.sourceforge.net/swig'
swig_tar="$prefix/swig-$SWIG_VER.tar.gz"
swig_zip="$prefix/swigwin-$SWIG_VER.zip"
test -d arc || mkdir arc
wget -nv -N -P arc "$swig_tar" "$swig_zip"
- name: Download junit jar file
if: ${{ contains(fromJson(steps.convert.outputs.targets), 'javahl') }}
env:
JUNIT_VER: ${{ fromJson(steps.convert.outputs.dependencies).junit }}
run: |
set -ex
junit_url="https://repo1.maven.org/maven2/junit/junit/$JUNIT_VER/junit-$JUNIT_VER.jar"
test -d arc || mkdir arc
wget -nv -N -P arc "$junit_url"
ubuntu:
if: ${{ needs.setup.outputs.ubuntu != '[]' }}
needs: setup
uses: ./.github/workflows/test-ubuntu.yml
secrets: inherit
with:
targets: ${{ needs.setup.outputs.targets }}
os: ${{ needs.setup.outputs.ubuntu }}
subversion: ${{ needs.setup.outputs.subversion }}
dependencies: ${{ needs.setup.outputs.dependencies }}
macos:
if: ${{ needs.setup.outputs.macos != '[]' }}
needs: setup
uses: ./.github/workflows/test-macos.yml
secrets: inherit
with:
targets: ${{ needs.setup.outputs.targets }}
os: ${{ needs.setup.outputs.macos }}
subversion: ${{ needs.setup.outputs.subversion }}
dependencies: ${{ needs.setup.outputs.dependencies }}
windows:
if: ${{ needs.setup.outputs.windows != '[]' }}
needs: setup
uses: ./.github/workflows/test-windows.yml
secrets: inherit
with:
targets: ${{ needs.setup.outputs.targets }}
os: ${{ needs.setup.outputs.windows }}
subversion: ${{ needs.setup.outputs.subversion }}
dependencies: ${{ needs.setup.outputs.dependencies }}