feat: add pluggable storage architecture (Phases 1-4) #43
Workflow file for this run
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: Go | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP')) | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Run go vet | |
| run: go vet ./internal/... | |
| - name: Run tests | |
| run: go test -coverprofile=cover.out -coverpkg=./internal/... ./internal/... | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 | |
| with: | |
| name: code-coverage | |
| path: cover.out | |
| - name: Download artifact (main.breakdown) | |
| id: download-main-breakdown | |
| uses: dawidd6/action-download-artifact@883bc3da0e2f55ddd0a8fc8e99378551c1991a55 # v13 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| branch: main | |
| workflow_conclusion: success | |
| name: main.breakdown | |
| if_no_artifact_found: warn | |
| - name: Check test coverage | |
| id: coverage | |
| uses: vladopajic/go-test-coverage/action/source@679e6807f68f2440a4c43d386442a1d0041838a9 # v2 | |
| with: | |
| profile: cover.out | |
| git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} | |
| git-branch: badges | |
| breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }} | |
| diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact == 'true' && 'main.breakdown' || '' }} | |
| - name: Upload artifact (main.breakdown) | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 | |
| if: github.ref_name == 'main' | |
| with: | |
| name: main.breakdown | |
| path: main.breakdown | |
| if-no-files-found: error | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP')) | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Build x64 DLL | |
| run: | | |
| docker run --rm -v "${{ github.workspace }}:/go/work" -w /go/work x1unix/go-mingw:1.24 \ | |
| go build -buildvcs=false -o dist/ocap_recorder_x64.dll -buildmode=c-shared ./cmd/ocap_recorder | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 | |
| with: | |
| name: dll-artifacts | |
| path: dist/ocap_recorder_x64.dll | |
| code_coverage: | |
| name: "Code coverage report" | |
| if: github.event_name == 'pull_request' && !github.event.pull_request.draft | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| steps: | |
| - uses: fgrosse/go-coverage-report@5226a7eae769f316df554bead7a716fcfd78130f # v1.2.0 | |
| with: | |
| coverage-artifact-name: "code-coverage" | |
| coverage-file-name: "cover.out" |