|
1 | | -name: CI |
| 1 | +# This file was automatically generated by sbt-github-actions using the |
| 2 | +# githubWorkflowGenerate task. You should add and commit this file to |
| 3 | +# your git repository. It goes without saying that you shouldn't edit |
| 4 | +# this file by hand! Instead, if you wish to make changes, you should |
| 5 | +# change your sbt build configuration to revise the workflow description |
| 6 | +# to meet your needs, then regenerate this file. |
2 | 7 |
|
3 | | -env: |
4 | | - JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1024M -Xmx3072M -Xss4M" |
| 8 | +name: Continuous Integration |
5 | 9 |
|
6 | 10 | on: |
7 | | - push: |
8 | | - branches: '**' |
9 | | - tags: [ "v[0-9]+*" ] |
10 | 11 | pull_request: |
11 | | - # avoid duplicate checks (push & PR) further in the review process |
12 | | - types: [opened] |
| 12 | + branches: ['**'] |
| 13 | + push: |
| 14 | + branches: ['**'] |
| 15 | + tags: [v*] |
| 16 | + |
| 17 | +env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + JAVA_OPTS: '-Dfile.encoding=UTF-8 -Xmx4G' |
13 | 20 |
|
14 | 21 | jobs: |
15 | | - test: |
16 | | - name: Run tests |
17 | | - runs-on: ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md |
| 22 | + build: |
| 23 | + name: Build and Test |
18 | 24 | strategy: |
19 | 25 | fail-fast: false |
20 | 26 | matrix: |
21 | | - scala: [ 2.13.16 ] |
22 | | - java-version: [ 17, 21, 25 ] |
23 | | - command: [ udash-jvm/test, udash-js/test, guide-selenium/test ] |
| 27 | + os: [ubuntu-latest] |
| 28 | + scala: [2.13.16] |
| 29 | + java: [temurin@17, temurin@21, temurin@25] |
| 30 | + command: [udash-jvm/test, udash-js/test, guide-selenium/test] |
| 31 | + runs-on: ${{ matrix.os }} |
24 | 32 | steps: |
25 | | - - uses: actions/checkout@v4 |
26 | | - - uses: actions/setup-java@v4 |
| 33 | + - name: Checkout current branch (full) |
| 34 | + uses: actions/checkout@v5 |
| 35 | + with: |
| 36 | + fetch-depth: 0 |
| 37 | + |
| 38 | + - name: Setup Java (temurin@17) |
| 39 | + if: matrix.java == 'temurin@17' |
| 40 | + uses: actions/setup-java@v5 |
27 | 41 | with: |
28 | 42 | distribution: temurin |
29 | | - java-version: ${{ matrix.java-version }} |
| 43 | + java-version: 17 |
30 | 44 | cache: sbt |
31 | | - - uses: actions/setup-node@v4 |
| 45 | + |
| 46 | + - name: Setup Java (temurin@21) |
| 47 | + if: matrix.java == 'temurin@21' |
| 48 | + uses: actions/setup-java@v5 |
32 | 49 | with: |
33 | | - cache: npm |
| 50 | + distribution: temurin |
| 51 | + java-version: 21 |
| 52 | + cache: sbt |
| 53 | + |
| 54 | + - name: Setup Java (temurin@25) |
| 55 | + if: matrix.java == 'temurin@25' |
| 56 | + uses: actions/setup-java@v5 |
| 57 | + with: |
| 58 | + distribution: temurin |
| 59 | + java-version: 25 |
| 60 | + cache: sbt |
| 61 | + |
| 62 | + - name: Setup sbt |
| 63 | + uses: sbt/setup-sbt@v1 |
| 64 | + |
| 65 | + - name: Setup Node.js |
| 66 | + uses: actions/setup-node@v4 |
| 67 | + |
34 | 68 | - name: Install npm dependencies |
35 | 69 | run: npm install |
| 70 | + |
| 71 | + - name: Check that workflows are up to date |
| 72 | + run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck |
| 73 | + |
36 | 74 | - name: Run tests |
37 | | - run: sbt ++${{ matrix.scala }} ${{ matrix.command }} |
| 75 | + run: sbt '++ ${{ matrix.scala }}' '${{ matrix.command }}' |
38 | 76 |
|
39 | 77 | publish: |
40 | | - name: Publish to Sonatype |
41 | | - # only run on tag push |
42 | | - if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v')) |
43 | | - needs: [ test ] |
44 | | - runs-on: ubuntu-22.04 |
| 78 | + name: Publish Artifacts |
| 79 | + needs: [build] |
| 80 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) |
| 81 | + strategy: |
| 82 | + matrix: |
| 83 | + os: [ubuntu-latest] |
| 84 | + scala: [2.13.16] |
| 85 | + java: [temurin@17] |
| 86 | + runs-on: ${{ matrix.os }} |
45 | 87 | steps: |
46 | | - - uses: actions/checkout@v4 |
47 | | - - name: Set up JDK |
48 | | - uses: actions/setup-java@v4 |
| 88 | + - name: Checkout current branch (full) |
| 89 | + uses: actions/checkout@v5 |
| 90 | + with: |
| 91 | + fetch-depth: 0 |
| 92 | + |
| 93 | + - name: Setup Java (temurin@17) |
| 94 | + if: matrix.java == 'temurin@17' |
| 95 | + uses: actions/setup-java@v5 |
49 | 96 | with: |
50 | 97 | distribution: temurin |
51 | 98 | java-version: 17 |
52 | 99 | cache: sbt |
53 | | - - name: Get version |
54 | | - id: get_tag_name |
55 | | - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
56 | | - - name: Publish artifacts |
57 | | - env: |
| 100 | + |
| 101 | + - name: Setup Java (temurin@21) |
| 102 | + if: matrix.java == 'temurin@21' |
| 103 | + uses: actions/setup-java@v5 |
| 104 | + with: |
| 105 | + distribution: temurin |
| 106 | + java-version: 21 |
| 107 | + cache: sbt |
| 108 | + |
| 109 | + - name: Setup Java (temurin@25) |
| 110 | + if: matrix.java == 'temurin@25' |
| 111 | + uses: actions/setup-java@v5 |
| 112 | + with: |
| 113 | + distribution: temurin |
| 114 | + java-version: 25 |
| 115 | + cache: sbt |
| 116 | + |
| 117 | + - name: Setup sbt |
| 118 | + uses: sbt/setup-sbt@v1 |
| 119 | + |
| 120 | + - env: |
58 | 121 | PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
59 | 122 | PGP_SECRET: ${{ secrets.PGP_SECRET }} |
60 | 123 | SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
|
0 commit comments