Add archive notice (#124) #773
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit Test | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.24' | |
| - uses: actions/checkout@v3 | |
| - name: Run Go Tests | |
| run: | | |
| make test-all | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: "${{ github.sha }}-coverage" | |
| path: ./profile.out | |
| tests-rocksdb: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.24' | |
| - uses: actions/checkout@v3 | |
| - name: Install RocksDB dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential pkg-config cmake git zlib1g-dev libbz2-dev libsnappy-dev liblz4-dev libzstd-dev libjemalloc-dev libgflags-dev liburing-dev | |
| - name: Cache RocksDB | |
| id: cache-rocksdb | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| /usr/local/lib/librocksdb.* | |
| /usr/local/include/rocksdb | |
| key: rocksdb-v8.9.1-${{ runner.os }} | |
| - name: Build and Install RocksDB from source | |
| if: steps.cache-rocksdb.outputs.cache-hit != 'true' | |
| run: | | |
| git clone https://github.com/facebook/rocksdb.git | |
| cd rocksdb | |
| git checkout v8.9.1 | |
| make clean | |
| CXXFLAGS='-march=native -DNDEBUG' make -j"$(nproc)" shared_lib | |
| sudo make install-shared | |
| cd .. | |
| - name: Configure RocksDB library path | |
| run: | | |
| echo '/usr/local/lib' | sudo tee /etc/ld.so.conf.d/rocksdb.conf | |
| sudo ldconfig | |
| - name: Run RocksDB Tests | |
| run: | | |
| export CGO_CFLAGS="-I/usr/local/include" | |
| export CGO_LDFLAGS="-L/usr/local/lib -lrocksdb -lz -lbz2 -lsnappy -llz4 -lzstd -ljemalloc" | |
| make test-rocksdb | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: "${{ github.sha }}-coverage-rocksdb" | |
| path: ./profile.out | |
| upload-coverage-report: | |
| needs: [tests, tests-rocksdb] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.24' | |
| # Download all coverage reports from the 'tests' job | |
| - name: Download coverage reports | |
| uses: actions/download-artifact@v4 | |
| - name: Set GOPATH | |
| run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
| - name: Add GOPATH/bin to PATH | |
| run: echo "GOBIN=$(go env GOPATH)/bin" >> $GITHUB_ENV | |
| - name: Install gocovmerge | |
| run: go get github.com/wadey/gocovmerge && go install github.com/wadey/gocovmerge | |
| - name: Merge coverage reports | |
| run: gocovmerge $(find . -type f -name '*profile.out') > coverage.txt | |
| - name: Check coverage report lines | |
| run: wc -l coverage.txt | |
| continue-on-error: true | |
| - name: Check coverage report files | |
| run: ls **/*profile.out | |
| continue-on-error: true | |
| # Now we upload the merged report to Codecov | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.txt | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |