|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - 1.5.x |
| 9 | + - 1.4.x |
| 10 | + - 1.3.x |
| 11 | + - 1.2.x |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + name: sbt test |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + scala: [2.13.10, 2.12.17] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v2 |
| 24 | + - name: Install Tabby OSS Cad Suite |
| 25 | + uses: ./.github/workflows/setup-oss-cad-suite |
| 26 | + - name: Setup Scala |
| 27 | + uses: olafurpg/setup-scala@v10 |
| 28 | + with: |
| 29 | + |
| 30 | + - name: Cache Scala |
| 31 | + uses: coursier/cache-action@v6 |
| 32 | + - name: Check Formatting (Scala 2.12 only) |
| 33 | + if: startsWith(matrix.scala, '2.12') |
| 34 | + run: sbt ++${{ matrix.scala }} scalafmtCheckAll |
| 35 | + - name: Unidoc |
| 36 | + run: sbt ++${{ matrix.scala }} unidoc |
| 37 | + - name: Sanity check benchmarking scripts (Scala 2.13 only) |
| 38 | + if: startsWith(matrix.scala, '2.13') |
| 39 | + run: | |
| 40 | + benchmark/scripts/benchmark_cold_compile.py -N 2 --designs regress/ICache.fir --versions HEAD |
| 41 | + benchmark/scripts/find_heap_bound.py -- -cp firrtl*jar firrtl.stage.FirrtlMain -i regress/ICache.fir -o out -X verilog |
| 42 | + - name: Test |
| 43 | + run: sbt ++${{ matrix.scala }} test |
| 44 | + - name: Binary compatibility |
| 45 | + run: sbt ++${{ matrix.scala }} mimaReportBinaryIssues |
| 46 | + |
| 47 | + mill: |
| 48 | + name: Mill Sanity Check |
| 49 | + runs-on: ubuntu-latest |
| 50 | + strategy: |
| 51 | + matrix: |
| 52 | + scala: [2.13.10, 2.12.17] |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v2 |
| 56 | + - name: Setup Scala |
| 57 | + uses: olafurpg/setup-scala@v10 |
| 58 | + - name: Cache |
| 59 | + uses: coursier/cache-action@v5 |
| 60 | + - name: Setup Mill |
| 61 | + |
| 62 | + - name: Mill sanity check |
| 63 | + run: mill _[${{ matrix.scala }}].compile |
| 64 | + |
| 65 | + # TODO find better way to express Ops and AddNot as single test |
| 66 | + equiv: |
| 67 | + name: formal equivalence |
| 68 | + runs-on: ubuntu-latest |
| 69 | + strategy: |
| 70 | + matrix: |
| 71 | + design: [RocketCore, FPU, ICache, Ops, AddNot] |
| 72 | + |
| 73 | + steps: |
| 74 | + - name: Checkout |
| 75 | + uses: actions/checkout@v2 |
| 76 | + - name: Install Tabby OSS Cad Suite |
| 77 | + uses: ./.github/workflows/setup-oss-cad-suite |
| 78 | + - name: Setup Scala |
| 79 | + uses: olafurpg/setup-scala@v10 |
| 80 | + with: |
| 81 | + |
| 82 | + - name: Cache Scala |
| 83 | + uses: coursier/cache-action@v5 |
| 84 | + - name: Run Formal Equivalence |
| 85 | + # This is here instead of on the whole job because if a job is skipped, so are dependent jobs |
| 86 | + # If this job were skipped, all_tests_passed would be skipped to |
| 87 | + # By having this "if" here, this job returns success so that all_tests_passed will succeed too |
| 88 | + if: github.event_name == 'pull_request' && |
| 89 | + ! contains(github.event.pull_request.labels.*.name, 'Skip Formal CI') |
| 90 | + run: | |
| 91 | + echo ${{ github.event_name }} |
| 92 | + echo ${{ github.event.pull_request.labels }} |
| 93 | + ./.run_formal_checks.sh ${{ matrix.design }} |
| 94 | +
|
| 95 | + # Sentinel job to simplify how we specify which checks need to pass in branch |
| 96 | + # protection and in Mergify |
| 97 | + # |
| 98 | + # When adding new jobs, please add them to `needs` below |
| 99 | + all_tests_passed: |
| 100 | + name: "all tests passed" |
| 101 | + needs: [test, mill, equiv] |
| 102 | + runs-on: ubuntu-latest |
| 103 | + steps: |
| 104 | + - run: echo Success! |
| 105 | + |
| 106 | + # sbt ci-release publishes all cross versions so this job needs to be |
| 107 | + # separate from a Scala versions build matrix to avoid duplicate publishing |
| 108 | + publish: |
| 109 | + needs: [all_tests_passed] |
| 110 | + runs-on: ubuntu-latest |
| 111 | + if: github.event_name == 'push' |
| 112 | + |
| 113 | + steps: |
| 114 | + - name: Checkout |
| 115 | + uses: actions/checkout@v2 |
| 116 | + - name: Setup Scala |
| 117 | + uses: olafurpg/setup-scala@v10 |
| 118 | + with: |
| 119 | + |
| 120 | + - name: Cache Scala |
| 121 | + uses: coursier/cache-action@v5 |
| 122 | + - name: Setup GPG (for Publish) |
| 123 | + uses: olafurpg/setup-gpg@v3 |
| 124 | + - name: Publish |
| 125 | + run: sbt ci-release |
| 126 | + env: |
| 127 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
| 128 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} |
| 129 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 130 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 131 | + |
0 commit comments