|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + tags: |
| 7 | + - "v*" |
| 8 | + pull_request: |
| 9 | + |
| 10 | +jobs: |
| 11 | + jvm-tests: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + submodules: true |
| 18 | + - uses: coursier/[email protected] |
| 19 | + - uses: coursier/setup-action@v1 |
| 20 | + with: |
| 21 | + jvm: 8 |
| 22 | + - run: | |
| 23 | + ./mill -i "integration.jvm.test" |
| 24 | + if: runner.os != 'Windows' |
| 25 | + - run: | |
| 26 | + @call ./mill.bat -i "integration.jvm.test" |
| 27 | + shell: cmd |
| 28 | + if: runner.os == 'Windows' |
| 29 | +
|
| 30 | + native-tests: |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v2 |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + submodules: true |
| 41 | + - uses: coursier/[email protected] |
| 42 | + - uses: coursier/setup-action@v1 |
| 43 | + with: |
| 44 | + jvm: 8 |
| 45 | + - run: | |
| 46 | + ./mill -i "cli.base-image.writeNativeImageScript" generate.sh "" && \ |
| 47 | + ./generate.sh && \ |
| 48 | + ./mill -i "cli.base-image.copyToArtifacts" artifacts/ |
| 49 | + if: runner.os != 'Windows' |
| 50 | + - run: | |
| 51 | + @call ./mill.bat -i "cli.base-image.writeNativeImageScript" generate.bat "" |
| 52 | + @call generate.bat |
| 53 | + @call ./mill.bat -i "cli.base-image.copyToArtifacts" artifacts/ |
| 54 | + shell: cmd |
| 55 | + if: runner.os == 'Windows' |
| 56 | + |
| 57 | + with: |
| 58 | + name: launchers |
| 59 | + path: artifacts/ |
| 60 | + if-no-files-found: error |
| 61 | + retention-days: 1 |
| 62 | + - run: ./mill -i "integration.native.test" |
| 63 | + if: github.event_name == 'push' |
| 64 | + |
| 65 | + native-static-tests: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + fetch-depth: 0 |
| 71 | + submodules: true |
| 72 | + - uses: coursier/[email protected] |
| 73 | + - uses: coursier/setup-action@v1 |
| 74 | + with: |
| 75 | + jvm: 8 |
| 76 | + - run: | |
| 77 | + ./mill -i "cli.static-image.writeNativeImageScript" generate.sh "" && \ |
| 78 | + ./generate.sh && \ |
| 79 | + ./mill -i "cli.static-image.copyToArtifacts" artifacts/ |
| 80 | + |
| 81 | + with: |
| 82 | + name: launchers |
| 83 | + path: artifacts/ |
| 84 | + if-no-files-found: error |
| 85 | + retention-days: 1 |
| 86 | + - run: ./mill -i "integration.static.test" |
| 87 | + if: github.event_name == 'push' |
| 88 | + |
| 89 | + native-mostly-static-tests: |
| 90 | + runs-on: ubuntu-latest |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v2 |
| 93 | + with: |
| 94 | + fetch-depth: 0 |
| 95 | + submodules: true |
| 96 | + - uses: coursier/[email protected] |
| 97 | + - uses: coursier/setup-action@v1 |
| 98 | + with: |
| 99 | + jvm: 8 |
| 100 | + - run: | |
| 101 | + ./mill -i "cli.mostly-static-image.writeNativeImageScript" generate.sh "" && \ |
| 102 | + ./generate.sh && \ |
| 103 | + ./mill -i "cli.mostly-static-image.copyToArtifacts" artifacts/ |
| 104 | + |
| 105 | + with: |
| 106 | + name: launchers |
| 107 | + path: artifacts/ |
| 108 | + if-no-files-found: error |
| 109 | + retention-days: 1 |
| 110 | + - run: ./mill -i "integration.mostly-static.test" |
| 111 | + if: github.event_name == 'push' |
| 112 | + |
| 113 | + upload-launchers: |
| 114 | + needs: [format, jvm-tests, native-tests, native-static-tests, native-mostly-static-tests] |
| 115 | + runs-on: ubuntu-latest |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v2 |
| 118 | + with: |
| 119 | + fetch-depth: 0 |
| 120 | + submodules: true |
| 121 | + - uses: coursier/[email protected] |
| 122 | + - uses: coursier/setup-action@v1 |
| 123 | + with: |
| 124 | + jvm: 8 |
| 125 | + - uses: actions/download-artifact@v2 |
| 126 | + with: |
| 127 | + name: launchers |
| 128 | + path: artifacts/ |
| 129 | + - run: ./mill -i ci.upload artifacts/ |
| 130 | + if: github.event_name == 'push' |
| 131 | + env: |
| 132 | + UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 133 | + |
| 134 | + format: |
| 135 | + timeout-minutes: 15 |
| 136 | + runs-on: ubuntu-latest |
| 137 | + steps: |
| 138 | + - uses: actions/checkout@v3 |
| 139 | + with: |
| 140 | + fetch-depth: 0 |
| 141 | + submodules: true |
| 142 | + - uses: coursier/[email protected] |
| 143 | + - uses: VirtusLab/scala-cli-setup@267af2f1ed4911180b4bb25619ca4a586753cbd1 |
| 144 | + with: |
| 145 | + jvm: "temurin:17" |
| 146 | + apps: scalafmt:3.0.0 |
| 147 | + - run: scalafmt --check |
| 148 | + |
| 149 | + publish: |
| 150 | + needs: [upload-launchers] |
| 151 | + if: github.event_name == 'push' |
| 152 | + runs-on: ubuntu-latest |
| 153 | + steps: |
| 154 | + - uses: actions/checkout@v3 |
| 155 | + with: |
| 156 | + fetch-depth: 0 |
| 157 | + submodules: true |
| 158 | + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_SCALA_CLI }} |
| 159 | + - uses: coursier/[email protected] |
| 160 | + - uses: VirtusLab/scala-cli-setup@267af2f1ed4911180b4bb25619ca4a586753cbd1 |
| 161 | + with: |
| 162 | + jvm: "temurin:17" |
| 163 | + - name: GPG setup |
| 164 | + run: .github/scripts/gpg-setup.sh |
| 165 | + env: |
| 166 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} |
| 167 | + - run: ./mill -i publishSonatype __.publishArtifacts |
| 168 | + env: |
| 169 | + PGP_PASSWORD: ${{ secrets.PGP_PASSPHRASE }} |
| 170 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 171 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
0 commit comments