|
| 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. |
| 7 | + |
| 8 | +name: Continuous Integration |
| 9 | + |
| 10 | +on: |
| 11 | + pull_request: |
| 12 | + branches: ['**'] |
| 13 | + push: |
| 14 | + branches: ['**'] |
| 15 | + tags: [v*] |
| 16 | + |
| 17 | +env: |
| 18 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
| 19 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 20 | + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} |
| 21 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 22 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: Build and Test |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + os: [ubuntu-latest] |
| 31 | + scala: [2.12.13, 2.13.8, 3.1.1] |
| 32 | + java: [temurin@8] |
| 33 | + project: [rootJS, rootJVM] |
| 34 | + runs-on: ${{ matrix.os }} |
| 35 | + steps: |
| 36 | + - name: Checkout current branch (full) |
| 37 | + uses: actions/checkout@v2 |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - name: Setup Java (temurin@8) |
| 42 | + if: matrix.java == 'temurin@8' |
| 43 | + uses: actions/setup-java@v2 |
| 44 | + with: |
| 45 | + distribution: temurin |
| 46 | + java-version: 8 |
| 47 | + |
| 48 | + - name: Cache sbt |
| 49 | + uses: actions/cache@v2 |
| 50 | + with: |
| 51 | + path: | |
| 52 | + ~/.sbt |
| 53 | + ~/.ivy2/cache |
| 54 | + ~/.coursier/cache/v1 |
| 55 | + ~/.cache/coursier/v1 |
| 56 | + ~/AppData/Local/Coursier/Cache/v1 |
| 57 | + ~/Library/Caches/Coursier/v1 |
| 58 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 59 | + |
| 60 | + - name: Set up cert permissions |
| 61 | + run: | |
| 62 | + chmod 600 world/server.key |
| 63 | + sudo chown 999 world/server.key |
| 64 | +
|
| 65 | + - name: Start up Postgres |
| 66 | + run: docker-compose up -d |
| 67 | + |
| 68 | + - name: Check that workflows are up to date |
| 69 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck |
| 70 | + |
| 71 | + - name: Check Headers |
| 72 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll |
| 73 | + |
| 74 | + - name: scalaJSLink |
| 75 | + if: matrix.project == 'rootJS' |
| 76 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult |
| 77 | + |
| 78 | + - name: Test |
| 79 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test |
| 80 | + |
| 81 | + - name: Check binary compatibility |
| 82 | + if: matrix.java == 'temurin@8' |
| 83 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues |
| 84 | + |
| 85 | + - name: Generate API documentation |
| 86 | + if: matrix.java == 'temurin@8' |
| 87 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc |
| 88 | + |
| 89 | + - name: Check Doc Site (2.13.8 JVM only) |
| 90 | + if: matrix.scala == '2.13.8' && matrix.project == 'rootJVM' |
| 91 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' docs/makeSite |
| 92 | + |
| 93 | + - name: Make target directories |
| 94 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 95 | + run: mkdir -p modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target |
| 96 | + |
| 97 | + - name: Compress target directories |
| 98 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 99 | + run: tar cf targets.tar modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target |
| 100 | + |
| 101 | + - name: Upload target directories |
| 102 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 103 | + uses: actions/upload-artifact@v2 |
| 104 | + with: |
| 105 | + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} |
| 106 | + path: targets.tar |
| 107 | + |
| 108 | + publish: |
| 109 | + name: Publish Artifacts |
| 110 | + needs: [build] |
| 111 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 112 | + strategy: |
| 113 | + matrix: |
| 114 | + os: [ubuntu-latest] |
| 115 | + scala: [2.13.8] |
| 116 | + java: [temurin@8] |
| 117 | + runs-on: ${{ matrix.os }} |
| 118 | + steps: |
| 119 | + - name: Checkout current branch (full) |
| 120 | + uses: actions/checkout@v2 |
| 121 | + with: |
| 122 | + fetch-depth: 0 |
| 123 | + |
| 124 | + - name: Setup Java (temurin@8) |
| 125 | + if: matrix.java == 'temurin@8' |
| 126 | + uses: actions/setup-java@v2 |
| 127 | + with: |
| 128 | + distribution: temurin |
| 129 | + java-version: 8 |
| 130 | + |
| 131 | + - name: Cache sbt |
| 132 | + uses: actions/cache@v2 |
| 133 | + with: |
| 134 | + path: | |
| 135 | + ~/.sbt |
| 136 | + ~/.ivy2/cache |
| 137 | + ~/.coursier/cache/v1 |
| 138 | + ~/.cache/coursier/v1 |
| 139 | + ~/AppData/Local/Coursier/Cache/v1 |
| 140 | + ~/Library/Caches/Coursier/v1 |
| 141 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 142 | + |
| 143 | + - name: Download target directories (2.12.13, rootJS) |
| 144 | + uses: actions/download-artifact@v2 |
| 145 | + with: |
| 146 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.13-rootJS |
| 147 | + |
| 148 | + - name: Inflate target directories (2.12.13, rootJS) |
| 149 | + run: | |
| 150 | + tar xf targets.tar |
| 151 | + rm targets.tar |
| 152 | +
|
| 153 | + - name: Download target directories (2.12.13, rootJVM) |
| 154 | + uses: actions/download-artifact@v2 |
| 155 | + with: |
| 156 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.13-rootJVM |
| 157 | + |
| 158 | + - name: Inflate target directories (2.12.13, rootJVM) |
| 159 | + run: | |
| 160 | + tar xf targets.tar |
| 161 | + rm targets.tar |
| 162 | +
|
| 163 | + - name: Download target directories (2.13.8, rootJS) |
| 164 | + uses: actions/download-artifact@v2 |
| 165 | + with: |
| 166 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS |
| 167 | + |
| 168 | + - name: Inflate target directories (2.13.8, rootJS) |
| 169 | + run: | |
| 170 | + tar xf targets.tar |
| 171 | + rm targets.tar |
| 172 | +
|
| 173 | + - name: Download target directories (2.13.8, rootJVM) |
| 174 | + uses: actions/download-artifact@v2 |
| 175 | + with: |
| 176 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM |
| 177 | + |
| 178 | + - name: Inflate target directories (2.13.8, rootJVM) |
| 179 | + run: | |
| 180 | + tar xf targets.tar |
| 181 | + rm targets.tar |
| 182 | +
|
| 183 | + - name: Download target directories (3.1.1, rootJS) |
| 184 | + uses: actions/download-artifact@v2 |
| 185 | + with: |
| 186 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJS |
| 187 | + |
| 188 | + - name: Inflate target directories (3.1.1, rootJS) |
| 189 | + run: | |
| 190 | + tar xf targets.tar |
| 191 | + rm targets.tar |
| 192 | +
|
| 193 | + - name: Download target directories (3.1.1, rootJVM) |
| 194 | + uses: actions/download-artifact@v2 |
| 195 | + with: |
| 196 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJVM |
| 197 | + |
| 198 | + - name: Inflate target directories (3.1.1, rootJVM) |
| 199 | + run: | |
| 200 | + tar xf targets.tar |
| 201 | + rm targets.tar |
| 202 | +
|
| 203 | + - name: Import signing key |
| 204 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' |
| 205 | + run: echo $PGP_SECRET | base64 -di | gpg --import |
| 206 | + |
| 207 | + - name: Import signing key and strip passphrase |
| 208 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' |
| 209 | + run: | |
| 210 | + echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg |
| 211 | + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg |
| 212 | + (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) |
| 213 | +
|
| 214 | + - name: Publish |
| 215 | + run: sbt '++${{ matrix.scala }}' tlRelease |
| 216 | + |
| 217 | + coverage: |
| 218 | + name: Generate coverage report (2.13.8 JVM only) |
| 219 | + strategy: |
| 220 | + matrix: |
| 221 | + os: [ubuntu-latest] |
| 222 | + scala: [2.13.8] |
| 223 | + java: [temurin@11] |
| 224 | + runs-on: ${{ matrix.os }} |
| 225 | + steps: |
| 226 | + - name: Checkout current branch (full) |
| 227 | + uses: actions/checkout@v2 |
| 228 | + with: |
| 229 | + fetch-depth: 0 |
| 230 | + |
| 231 | + - name: Setup Java (temurin@8) |
| 232 | + if: matrix.java == 'temurin@8' |
| 233 | + uses: actions/setup-java@v2 |
| 234 | + with: |
| 235 | + distribution: temurin |
| 236 | + java-version: 8 |
| 237 | + |
| 238 | + - name: Cache sbt |
| 239 | + uses: actions/cache@v2 |
| 240 | + with: |
| 241 | + path: | |
| 242 | + ~/.sbt |
| 243 | + ~/.ivy2/cache |
| 244 | + ~/.coursier/cache/v1 |
| 245 | + ~/.cache/coursier/v1 |
| 246 | + ~/AppData/Local/Coursier/Cache/v1 |
| 247 | + ~/Library/Caches/Coursier/v1 |
| 248 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 249 | + |
| 250 | + - name: Set up cert permissions |
| 251 | + run: | |
| 252 | + chmod 600 world/server.key |
| 253 | + sudo chown 999 world/server.key |
| 254 | +
|
| 255 | + - name: Start up Postgres |
| 256 | + run: docker-compose up -d |
| 257 | + |
| 258 | + - run: sbt '++${{ matrix.scala }}' coverage rootJVM/test coverageReport |
| 259 | + |
| 260 | + - name: Upload code coverage data |
| 261 | + run: 'bash <(curl -s https://codecov.io/bash)' |
0 commit comments