|
5 | 5 | paths-ignore: |
6 | 6 | - 'README.md' |
7 | 7 | pull_request: |
8 | | - types: [assigned, opened, synchronize, reopened, ready_for_review, edited] |
9 | 8 | paths-ignore: |
10 | 9 | - 'README.md' |
11 | 10 | schedule: |
12 | 11 | - cron: '0 0 * * *' |
13 | 12 |
|
14 | | -env: |
15 | | - JVM_TEST_MAVEN_OPTS: "-e -B" |
16 | | - |
17 | 13 | jobs: |
18 | | - build-jdk11: |
19 | | - name: "JDK 11 Build" |
20 | | - runs-on: ubuntu-latest |
21 | | - # Skip draft PRs and those with WIP in the subject, rerun as soon as its removed |
22 | | - if: "github.event_name != 'pull_request' || ( \ |
23 | | - github.event.pull_request.draft == false && \ |
24 | | - github.event.pull_request.state != 'closed' && \ |
25 | | - contains(github.event.pull_request.title, 'wip ') == false && \ |
26 | | - contains(github.event.pull_request.title, '[wip]') == false && \ |
27 | | - ( |
28 | | - github.event.action != 'edited' || \ |
29 | | - contains(github.event.changes.title.from, 'wip ') || \ |
30 | | - contains(github.event.changes.title.from, '[wip]') \ |
31 | | - ) \ |
32 | | - )" |
33 | | - steps: |
34 | | - - uses: actions/checkout@v2 |
35 | | - - uses: n1hility/cancel-previous-runs@v2 |
36 | | - if: github.event_name == 'pull_request' |
37 | | - with: |
38 | | - token: ${{ secrets.GITHUB_TOKEN }} |
39 | | - - name: Set up JDK 11 |
40 | | - # Uses sha for added security since tags can be updated |
41 | | - uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d |
42 | | - with: |
43 | | - java-version: 11 |
44 | | - - name: Compute cache restore key |
45 | | - # Always recompute on a push so that the maven repo doesnt grow indefinitely with old versions |
46 | | - run: | |
47 | | - if ${{ github.event_name == 'pull_request' }}; then echo "::set-env name=COMPUTED_RESTORE_KEY::q2maven-"; fi |
48 | | - - name: Cache Maven Repository |
49 | | - id: cache-maven |
50 | | - uses: n1hility/cache@v2 |
51 | | - with: |
52 | | - path: ~/.m2/repository |
53 | | - # Improves the reusability of the cache to limit key changes |
54 | | - key: q2maven-${{ hashFiles('pom.xml') }} |
55 | | - restore-keys: ${{ env.COMPUTED_RESTORE_KEY }} |
56 | | - restore-only: ${{ github.event_name == 'pull_request' }} |
57 | | - - name: Build |
58 | | - run: | |
59 | | - mvn -e -B -DskipTests=true -DskipDocs clean install |
60 | | - - name: Tar Maven Repo |
61 | | - shell: bash |
62 | | - run: tar -czvf maven-repo.tgz -C ~ .m2/repository |
63 | | - - name: Persist Maven Repo |
64 | | - uses: actions/upload-artifact@v1 |
65 | | - with: |
66 | | - name: maven-repo |
67 | | - path: maven-repo.tgz |
68 | | - |
69 | 14 | linux-jvm-tests: |
70 | | - name: JDK 11 JVM Tests |
71 | | - timeout-minutes: 120 |
72 | | - needs: build-jdk11 |
73 | | - runs-on: ubuntu-latest |
74 | | - steps: |
75 | | - - uses: actions/checkout@v2 |
76 | | - - name: Set up JDK ${{ matrix.java-version }} |
77 | | - # Uses sha for added security since tags can be updated |
78 | | - uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d |
79 | | - with: |
80 | | - java-version: 11 |
81 | | - - name: Download Maven Repo |
82 | | - uses: actions/download-artifact@v1 |
83 | | - with: |
84 | | - name: maven-repo |
85 | | - path: . |
86 | | - - name: Extract Maven Repo |
87 | | - shell: bash |
88 | | - run: tar -xzvf maven-repo.tgz -C ~ |
89 | | - - name: Build with Maven |
90 | | - run: mvn test -P '!services' |
91 | | - - name: Prepare failure archive (if maven failed) |
92 | | - if: failure() |
93 | | - shell: bash |
94 | | - run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T - |
95 | | - - name: Upload failure Archive (if maven failed) |
96 | | - uses: actions/upload-artifact@v1 |
97 | | - if: failure() |
98 | | - with: |
99 | | - name: test-reports-linux-jvm11 |
100 | | - path: 'test-reports.tgz' |
101 | | - |
102 | | - linux-jvm-tests-ee: |
103 | | - name: JDK 11 JVM Tests EE |
104 | | - timeout-minutes: 120 |
105 | | - needs: build-jdk11 |
| 15 | + name: Tests |
106 | 16 | runs-on: ubuntu-latest |
107 | 17 | steps: |
108 | 18 | - uses: actions/checkout@v2 |
109 | | - - name: Set up JDK ${{ matrix.java-version }} |
110 | | - # Uses sha for added security since tags can be updated |
111 | | - uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d |
| 19 | + - uses: actions/setup-java@v1 |
112 | 20 | with: |
113 | 21 | java-version: 11 |
114 | | - - name: Download Maven Repo |
115 | | - uses: actions/download-artifact@v1 |
116 | | - with: |
117 | | - name: maven-repo |
118 | | - path: . |
119 | | - - name: Extract Maven Repo |
120 | | - shell: bash |
121 | | - run: tar -xzvf maven-repo.tgz -C ~ |
122 | | - - name: Build with Maven |
123 | | - run: mvn test -P services -Dopenubl.storage.type=s3 -Dopenubl.event-manager=jms |
| 22 | + - name: Maven |
| 23 | + run: mvn verify |
124 | 24 | - name: Prepare failure archive (if maven failed) |
125 | 25 | if: failure() |
126 | 26 | shell: bash |
127 | 27 | run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T - |
128 | | - - name: Upload failure Archive (if maven failed) |
| 28 | + - name: Upload failure archive (if maven failed) |
129 | 29 | uses: actions/upload-artifact@v1 |
130 | 30 | if: failure() |
131 | 31 | with: |
132 | | - name: test-reports-linux-jvm11 |
| 32 | + name: test-reports |
133 | 33 | path: 'test-reports.tgz' |
134 | 34 |
|
135 | | - java-artifacts: |
136 | | - name: Java Artifacts |
137 | | - needs: build-jdk11 |
138 | | - runs-on: ubuntu-latest |
139 | | - steps: |
140 | | - - uses: actions/checkout@v2 |
141 | | - - name: Set up JDK 11 |
142 | | - # Uses sha for added security since tags can be updated |
143 | | - uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d |
144 | | - with: |
145 | | - java-version: 11 |
146 | | - - name: Download Maven Repo |
147 | | - uses: actions/download-artifact@v1 |
148 | | - with: |
149 | | - name: maven-repo |
150 | | - path: . |
151 | | - - name: Extract Maven Repo |
152 | | - shell: bash |
153 | | - run: tar -xzvf maven-repo.tgz -C ~ |
154 | | - - name: Build with Maven |
155 | | - run: | |
156 | | - mvn -DskipTests package |
157 | | - - name: Prepare XML Sender archive |
158 | | - shell: bash |
159 | | - run: | |
160 | | - find api/target -name 'lib' -o -name 'xsender-server-api-*-runner.jar' | tar -czvf xsender-server-java-artifacts.tgz -T - |
161 | | - - name: Upload Archive XML Sender |
162 | | - uses: actions/upload-artifact@v1 |
163 | | - with: |
164 | | - name: xsender-server-java-artifacts |
165 | | - path: 'xsender-server-java-artifacts.tgz' |
166 | | - |
167 | 35 | container-images: |
168 | 36 | name: Container Images |
169 | | - needs: java-artifacts |
170 | 37 | if: github.event_name != 'pull_request' |
171 | 38 | runs-on: ubuntu-latest |
172 | 39 | steps: |
173 | 40 | - uses: actions/checkout@v2 |
174 | | - - name: Download Java XML Sender Artifacts |
175 | | - uses: actions/download-artifact@v1 |
| 41 | + - uses: actions/setup-java@v1 |
176 | 42 | with: |
177 | | - name: xsender-server-java-artifacts |
178 | | - path: . |
179 | | - - name: Extract Java Artifacs |
180 | | - shell: bash |
181 | | - run: tar -xzvf xsender-server-java-artifacts.tgz |
182 | | - - name: Publish to Registry XML Builder |
183 | | - # Uses sha for added security since tags can be updated |
184 | | - uses: elgohr/Publish-Docker-Github-Action@b2f63259b466ca5a4be395c392546de447450334 |
| 43 | + java-version: 11 |
| 44 | + - name: Build with Maven |
| 45 | + run: mvn package -DskipTests -Dquarkus.package.type=fast-jar |
| 46 | + - name: Push to GitHub Packages |
| 47 | + uses: elgohr/Publish-Docker-Github-Action@master |
| 48 | + with: |
| 49 | + registry: docker.pkg.github.com |
| 50 | + name: project-openubl/xsender-server/xsender-server |
| 51 | + username: ${{ github.actor }} |
| 52 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + dockerfile: src/main/docker/Dockerfile.fast-jar |
| 54 | + snapshot: false |
| 55 | + tags: "master" |
| 56 | + - name: Push to Docker Hub |
| 57 | + uses: elgohr/Publish-Docker-Github-Action@master |
185 | 58 | with: |
186 | 59 | name: projectopenubl/xsender-server |
187 | | - dockerfile: api/src/main/docker/Dockerfile.jvm |
188 | 60 | username: ${{ secrets.DOCKER_USERNAME }} |
189 | 61 | password: ${{ secrets.DOCKER_PASSWORD }} |
| 62 | + dockerfile: src/main/docker/Dockerfile.fast-jar |
190 | 63 | snapshot: false |
191 | 64 | tags: "master" |
0 commit comments