|
15 | 15 | # limitations under the License.
|
16 | 16 | #
|
17 | 17 |
|
18 |
| -name: build |
| 18 | +name: master-build |
19 | 19 |
|
20 | 20 | on:
|
21 | 21 | push:
|
22 | 22 | branches:
|
23 | 23 | - master
|
24 |
| - pull_request: |
25 |
| - branches: |
26 |
| - - master |
27 | 24 |
|
28 | 25 | jobs:
|
29 |
| - compile: |
30 |
| - runs-on: ${{ matrix.os }} |
31 |
| - strategy: |
32 |
| - matrix: |
33 |
| - os: [ ubuntu-latest, windows-latest ] |
34 |
| - java: [ '8' ] |
35 |
| - steps: |
36 |
| - - uses: actions/checkout@v3 |
37 |
| - |
38 |
| - - name: Set up JDK ${{ matrix.java }} |
39 |
| - uses: actions/setup-java@v3 |
40 |
| - with: |
41 |
| - distribution: temurin |
42 |
| - java-version: ${{ matrix.java }} |
43 |
| - |
44 |
| - - uses: actions/cache@v3 |
45 |
| - with: |
46 |
| - path: ~/.m2/repository |
47 |
| - key: ${{ matrix.os }}-maven-${{ hashFiles('**/pom.xml') }} |
48 |
| - restore-keys: | |
49 |
| - ${{ matrix.os }}-maven- |
50 |
| -
|
51 |
| - - name: Build with maven |
52 |
| - run: mvn -B --errors --activate-profiles ci --no-transfer-progress package -DskipTests |
53 |
| - |
54 |
| - test: |
55 |
| - needs: compile |
56 |
| - runs-on: ${{ matrix.os }} |
57 |
| - strategy: |
58 |
| - matrix: |
59 |
| - os: [ ubuntu-latest, windows-latest ] |
60 |
| - java: [ '8', '11', '17' ] |
61 |
| - steps: |
62 |
| - - uses: actions/checkout@v3 |
63 |
| - |
64 |
| - - name: Set up JDK ${{ matrix.java }} |
65 |
| - uses: actions/setup-java@v3 |
66 |
| - with: |
67 |
| - distribution: temurin |
68 |
| - java-version: ${{ matrix.java }} |
69 |
| - |
70 |
| - - uses: actions/cache@v3 |
71 |
| - with: |
72 |
| - path: ~/.m2/repository |
73 |
| - key: ${{ matrix.os }}-maven-${{ hashFiles('**/pom.xml') }} |
74 |
| - restore-keys: | |
75 |
| - ${{ matrix.os }}-maven- |
76 |
| -
|
77 |
| - - name: Build and test with maven |
78 |
| - # Skip all static checks, they were already done in the compile jobs |
79 |
| - run: mvn -B --errors --activate-profiles ci --no-transfer-progress package |
80 |
| - |
81 |
| - - name: Archive test results and logs |
82 |
| - # if: success() || failure() to also get the test results on successful runs. |
83 |
| - if: failure() |
84 |
| - uses: actions/upload-artifact@v3 |
85 |
| - with: |
86 |
| - name: test-results-${{ matrix.java }}-${{ matrix.os }} |
87 |
| - path: sshd-*/target/surefire-* |
| 26 | + build: |
| 27 | + uses: ./.github/workflows/build.yml |
88 | 28 |
|
89 | 29 | deploy-snapshot:
|
90 |
| - # Run only on pushes or PR merges to the master branch, but not on PRs themselves. |
91 |
| - # Also skip any commit from creating releases. The first snapshot after a new release |
| 30 | + # Skip any commit from creating releases. The first snapshot after a new release |
92 | 31 | # will thus be published on the first real change on the new snapshot version, but
|
93 | 32 | # there will be no snapshot release for just bumping the version.
|
94 |
| - if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && !startsWith(github.event.head_commit.message ,'[maven-release-plugin]')" |
95 |
| - needs: test |
| 33 | + if: "!startsWith(github.event.head_commit.message ,'[maven-release-plugin]')" |
| 34 | + needs: build |
96 | 35 | # Serialize these jobs from different workflow runs. We do not want concurrent
|
97 | 36 | # deployments. We don't cancel already running jobs because we do not want their
|
98 | 37 | # workflows to report a failure. Github does not guarantee order between jobs
|
|
0 commit comments