|
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 }} |
13 | 19 |
|
14 | 20 | 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 |
| 21 | + build: |
| 22 | + name: Build and Test |
18 | 23 | strategy: |
19 | | - fail-fast: false |
20 | 24 | matrix: |
| 25 | + os: [ ubuntu-latest ] |
21 | 26 | scala: [ 2.13.16 ] |
22 | | - java-version: [ 17, 21, 25 ] |
23 | | - command: [ udash-jvm/test, udash-js/test, guide-selenium/test ] |
| 27 | + java: [ temurin@17, temurin@21, temurin@25 ] |
| 28 | + runs-on: ${{ matrix.os }} |
24 | 29 | steps: |
25 | | - - uses: actions/checkout@v4 |
26 | | - - uses: actions/setup-java@v4 |
| 30 | + - name: Checkout current branch (full) |
| 31 | + uses: actions/checkout@v5 |
| 32 | + with: |
| 33 | + fetch-depth: 0 |
| 34 | + |
| 35 | + - name: Setup Java (temurin@17) |
| 36 | + if: matrix.java == 'temurin@17' |
| 37 | + uses: actions/setup-java@v5 |
27 | 38 | with: |
28 | 39 | distribution: temurin |
29 | | - java-version: ${{ matrix.java-version }} |
| 40 | + java-version: 17 |
30 | 41 | cache: sbt |
31 | | - - uses: actions/setup-node@v4 |
| 42 | + |
| 43 | + - name: Setup Java (temurin@21) |
| 44 | + if: matrix.java == 'temurin@21' |
| 45 | + uses: actions/setup-java@v5 |
32 | 46 | with: |
33 | | - cache: npm |
34 | | - - name: Install npm dependencies |
35 | | - run: npm install |
36 | | - - name: Run tests |
37 | | - run: sbt ++${{ matrix.scala }} ${{ matrix.command }} |
| 47 | + distribution: temurin |
| 48 | + java-version: 21 |
| 49 | + cache: sbt |
| 50 | + |
| 51 | + - name: Setup Java (temurin@25) |
| 52 | + if: matrix.java == 'temurin@25' |
| 53 | + uses: actions/setup-java@v5 |
| 54 | + with: |
| 55 | + distribution: temurin |
| 56 | + java-version: 25 |
| 57 | + cache: sbt |
| 58 | + |
| 59 | + - name: Setup sbt |
| 60 | + uses: sbt/setup-sbt@v1 |
| 61 | + |
| 62 | + - name: Setup Node.js |
| 63 | + uses: actions/setup-node@v4 |
| 64 | + |
| 65 | + - name: Check that workflows are up to date |
| 66 | + run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck |
| 67 | + |
| 68 | + - name: Build project |
| 69 | + run: sbt '++ ${{ matrix.scala }}' test |
38 | 70 |
|
39 | 71 | 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 |
| 72 | + name: Publish Artifacts |
| 73 | + needs: [ build ] |
| 74 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) |
| 75 | + strategy: |
| 76 | + matrix: |
| 77 | + os: [ ubuntu-latest ] |
| 78 | + scala: [ 2.13.16 ] |
| 79 | + java: [ temurin@17 ] |
| 80 | + runs-on: ${{ matrix.os }} |
45 | 81 | steps: |
46 | | - - uses: actions/checkout@v4 |
47 | | - - name: Set up JDK |
48 | | - uses: actions/setup-java@v4 |
| 82 | + - name: Checkout current branch (full) |
| 83 | + uses: actions/checkout@v5 |
| 84 | + with: |
| 85 | + fetch-depth: 0 |
| 86 | + |
| 87 | + - name: Setup Java (temurin@17) |
| 88 | + if: matrix.java == 'temurin@17' |
| 89 | + uses: actions/setup-java@v5 |
49 | 90 | with: |
50 | 91 | distribution: temurin |
51 | 92 | java-version: 17 |
52 | 93 | 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: |
| 94 | + |
| 95 | + - name: Setup Java (temurin@21) |
| 96 | + if: matrix.java == 'temurin@21' |
| 97 | + uses: actions/setup-java@v5 |
| 98 | + with: |
| 99 | + distribution: temurin |
| 100 | + java-version: 21 |
| 101 | + cache: sbt |
| 102 | + |
| 103 | + - name: Setup Java (temurin@25) |
| 104 | + if: matrix.java == 'temurin@25' |
| 105 | + uses: actions/setup-java@v5 |
| 106 | + with: |
| 107 | + distribution: temurin |
| 108 | + java-version: 25 |
| 109 | + cache: sbt |
| 110 | + |
| 111 | + - name: Setup sbt |
| 112 | + uses: sbt/setup-sbt@v1 |
| 113 | + |
| 114 | + - env: |
58 | 115 | PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
59 | 116 | PGP_SECRET: ${{ secrets.PGP_SECRET }} |
60 | 117 | SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
|
0 commit comments