[attachments] inline images support #248
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 | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master] | |
| paths: | |
| - "**.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".golangci.yml" | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - "**.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".golangci.yml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| golangci: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| # step 1: checkout repository code | |
| - name: Checkout code into workspace directory | |
| uses: actions/checkout@v4 | |
| # step 2: set up go | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| # step 3: set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| # step 4: install swag CLI | |
| - name: Install swag CLI | |
| run: go install github.com/swaggo/swag/cmd/swag@latest | |
| # step 5: codegen | |
| - name: Run codegen | |
| run: go generate ./... | |
| # step 6: run golangci-lint | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| # step 1: checkout repository code | |
| - name: Checkout code into workspace directory | |
| uses: actions/checkout@v4 | |
| # step 2: set up go | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| # step 3: install dependencies | |
| - name: Install all Go dependencies | |
| run: go mod download | |
| # step 4: set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| # step 5: install swag CLI | |
| - name: Install swag CLI | |
| run: go install github.com/swaggo/swag/cmd/swag@latest | |
| # step 6: codegen | |
| - name: Run codegen | |
| run: go generate ./... | |
| # step 7: run test | |
| - name: Run coverage | |
| run: go test -race -shuffle=on -count=1 -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./... | |
| # step 8: upload coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| benchmark: | |
| name: Benchmark | |
| runs-on: ubuntu-latest | |
| if: false | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| # step 1: checkout repository code | |
| - name: Checkout code into workspace directory | |
| uses: actions/checkout@v4 | |
| # step 2: set up go | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| # step 3: install dependencies | |
| - name: Install all Go dependencies | |
| run: go mod download | |
| # step 4: set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| # step 5: install swag CLI | |
| - name: Install swag CLI | |
| run: go install github.com/swaggo/swag/cmd/swag@latest | |
| # step 6: restore previous benchmark history (if exists) | |
| - name: Restore benchmark history | |
| id: benchmark-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ./cache | |
| key: ${{ runner.os }}-benchmark-${{ github.ref_name }} | |
| restore-keys: | | |
| ${{ runner.os }}-benchmark- | |
| # step 7: codegen | |
| - name: Run codegen | |
| run: go generate ./... | |
| # step 8: run benchmark | |
| - name: Run benchmarks | |
| run: go test -run=^$ -bench=. -benchmem ./... | tee benchmark.txt | |
| # step 9: upload benchmark | |
| - name: Upload benchmark results | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| # What benchmark tool the benchmark.txt came from | |
| tool: "go" | |
| # Where the output from the benchmark tool is stored | |
| output-file-path: benchmark.txt | |
| # Where the previous data file is stored | |
| external-data-json-path: ./cache/benchmark-data.json | |
| # Workflow will fail when an alert happens | |
| fail-on-alert: true | |
| # step 10: persist updated benchmark history | |
| - name: Save benchmark history | |
| if: always() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ./cache | |
| key: ${{ runner.os }}-benchmark-${{ github.ref_name }}-${{ github.run_id }} | |
| e2e-test: | |
| name: E2E Test | |
| runs-on: ubuntu-latest | |
| if: false | |
| needs: test | |
| steps: | |
| # step 1: checkout repository code | |
| - name: Checkout code into workspace directory | |
| uses: actions/checkout@v4 | |
| # step 2: set up go | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| # step 3: install main project dependencies | |
| - name: Install main Go dependencies | |
| run: go mod download | |
| # step 4: set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| # step 5: install swag CLI | |
| - name: Install swag CLI | |
| run: go install github.com/swaggo/swag/cmd/swag@latest | |
| # step 6: codegen | |
| - name: Run codegen | |
| run: go generate ./... | |
| # step 7: install e2e test dependencies | |
| - name: Install E2E test dependencies | |
| run: cd tests/e2e && go mod download | |
| # step 8: run e2e tests with verbose output | |
| - name: Run E2E tests | |
| run: cd tests/e2e && go test -v ./... |