chore: promote main to stable #1306
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: MaaS API | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - 'maas-api/**' | |
| permissions: | |
| actions: read | |
| contents: read | |
| env: | |
| PROJECT_DIR: maas-api | |
| defaults: | |
| run: | |
| working-directory: maas-api | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Align golangci-lint version with Makefile | |
| id: golangci-version | |
| run: | | |
| VERSION=$(grep '^GOLANGCI_LINT_VERSION' tools.mk | cut -d'=' -f2 | tr -d ' ?') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: maas-api/go.mod | |
| cache: true | |
| cache-dependency-path: maas-api/go.sum | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: ${{ steps.golangci-version.outputs.version }} | |
| working-directory: ${{ env.PROJECT_DIR }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: ${{ env.PROJECT_DIR }}/go.mod | |
| cache: true | |
| cache-dependency-path: ${{ env.PROJECT_DIR }}/go.sum | |
| - name: Run tests | |
| run: make test | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-reports | |
| path: | | |
| ${{ env.PROJECT_DIR }}/coverage.out | |
| ${{ env.PROJECT_DIR }}/coverage.html | |
| retention-days: 30 | |
| - name: Build image | |
| run: make build-image |