|
| 1 | +name: Memory Profile Comparison |
| 2 | + |
| 3 | +on: pull_request |
| 4 | + |
| 5 | +jobs: |
| 6 | + compare-memory-profiles: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout main branch |
| 10 | + uses: actions/checkout@v2 |
| 11 | + with: |
| 12 | + ref: 'main' |
| 13 | + |
| 14 | + - name: Set up Go (main branch) |
| 15 | + uses: actions/setup-go@v2 |
| 16 | + with: |
| 17 | + go-version: '1.19' |
| 18 | + |
| 19 | + - name: Generate memory profile for main branch |
| 20 | + run: make profile-memory OUTFILE_SUFFIX=.main |
| 21 | + |
| 22 | + - name: Save main branch memory profile |
| 23 | + uses: actions/upload-artifact@v2 |
| 24 | + with: |
| 25 | + name: memprofile-main |
| 26 | + path: | |
| 27 | + memprofile.main.out |
| 28 | + memprofile.main.text |
| 29 | + |
| 30 | + - name: Checkout feature branch |
| 31 | + uses: actions/checkout@v2 |
| 32 | + with: |
| 33 | + ref: ${{ github.head_ref }} |
| 34 | + |
| 35 | + - name: Set up Go (feature branch) |
| 36 | + uses: actions/setup-go@v2 |
| 37 | + with: |
| 38 | + go-version: '1.19' |
| 39 | + |
| 40 | + - name: Generate memory profile for feature branch |
| 41 | + run: make profile-memory OUTFILE_SUFFIX=.feat |
| 42 | + |
| 43 | + - name: Save feat branch memory profile |
| 44 | + uses: actions/upload-artifact@v2 |
| 45 | + with: |
| 46 | + name: memprofile-feat |
| 47 | + path: | |
| 48 | + memprofile.feat.out |
| 49 | + memprofile.feat.text |
| 50 | +
|
| 51 | + - name: Download main branch memory profile |
| 52 | + uses: actions/download-artifact@v2 |
| 53 | + with: |
| 54 | + name: memprofile-main |
| 55 | + path: . |
| 56 | + |
| 57 | + - name: Compare memory profiles |
| 58 | + run: make profile-memory-compare BASE_FILE=memprofile.main.out COMPARE_FILE=memprofile.feat.out > memory-profile-comparison.text |
| 59 | + |
| 60 | + - name: Upload comparison result |
| 61 | + uses: actions/upload-artifact@v2 |
| 62 | + with: |
| 63 | + name: memory-profile-comparison |
| 64 | + path: memory-profile-comparison.text |
0 commit comments