Repository navigation
77 lines (70 loc) · 3.35 KB
/
Copy pathprotocol-e2e.yml
File metadata and controls
77 lines (70 loc) · 3.35 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
name: Protocol E2E (REST / GraphQL / gRPC)
# Stands up a Spring Boot server exposing the same logical service over REST
# (OpenAPI), GraphQL and gRPC-Web, then builds a Codename One client whose
# generated-style @RestClient / @GraphQLClient / @GrpcClient code is wired by
# process-annotations and run on the JavaSE simulator (cn1:test). The client
# performs real round-trips against all three endpoints and asserts the
# responses -- an end-to-end check of the full generated-client stack.
on:
pull_request:
paths:
- 'scripts/protocol-e2e/**'
- 'CodenameOne/src/com/codename1/io/graphql/**'
- 'CodenameOne/src/com/codename1/annotations/graphql/**'
- 'CodenameOne/src/com/codename1/io/grpc/**'
- 'CodenameOne/src/com/codename1/io/rest/**'
- 'maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/**'
- '.github/workflows/protocol-e2e.yml'
push:
branches: [ master ]
paths:
- 'scripts/protocol-e2e/**'
- 'CodenameOne/src/com/codename1/io/graphql/**'
- 'CodenameOne/src/com/codename1/annotations/graphql/**'
- '.github/workflows/protocol-e2e.yml'
workflow_dispatch:
jobs:
protocol-e2e:
runs-on: ubuntu-latest
container: ghcr.io/codenameone/codenameone/pr-ci-container:latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Install Codename One artifacts (core / javase / css-compiler / plugin)
# This step builds rather than tests, and it still narrows what it will retry: a
# compilation failure has to fail on the first attempt. What it covers is the run that died
# here with "Unresolveable build extension: archetype-packaging ... could not be resolved"
# before anything was compiled, which is Maven Central rather than this repository.
env:
RETRY_ONLY_MATCHING: transient
# Five attempts a minute apart rather than three at thirty seconds: Central
# refused two different jobs on this branch today, and a window of about a
# minute is shorter than the incidents have been. It costs nothing on a real
# failure, which RETRY_ONLY_MATCHING returns on the first attempt.
RETRY_ATTEMPTS: '5'
RETRY_DELAY_SECONDS: '60'
run: |
export JAVA_HOME="${JAVA_HOME_8}"
export PATH="${JAVA_HOME_8}/bin:$PATH"
cd maven
bash ../scripts/ci/retry.sh mvn -B -pl core,javase,css-compiler,codenameone-maven-plugin -am install \
-Plocal-dev-javase -DskipTests -Dmaven.javadoc.skip=true
- name: Ensure a virtual display (xvfb) for the simulator
run: |
if ! command -v xvfb-run >/dev/null 2>&1; then
# Bounded: the failure is already tolerated, but a mirror that stalls rather than
# refusing would hold the job instead of falling through.
(timeout 300 apt-get update && timeout 300 apt-get install -y xvfb) || true
fi
- name: Run REST / GraphQL / gRPC end-to-end
run: |
export JAVA_HOME="${JAVA_HOME_17}"
export PATH="${JAVA_HOME_17}/bin:$PATH"
scripts/protocol-e2e/run-protocol-e2e.sh
- name: Upload server log
if: always()
uses: actions/upload-artifact@v4
with:
name: protocol-e2e-server-log
path: /tmp/protocol-e2e-server.log
if-no-files-found: ignore