Automate CI/CD: e2e tests in CI, .gitignore, modernized Makefile #30
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: build | |
| on: | |
| push: | |
| branches: ['*'] | |
| tags: ['v*'] | |
| pull_request: | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Unit tests | |
| run: go test -mod vendor -race ./... | |
| e2e: | |
| runs-on: ubuntu-latest | |
| services: | |
| daptin: | |
| image: daptin/daptin | |
| ports: | |
| - 6336:6336 | |
| options: >- | |
| --health-cmd "curl -sf http://localhost:6336/api/world || exit 1" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 10 | |
| --health-start-period 15s | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| run: go build -mod vendor -o daptin-cli . | |
| - name: E2E tests | |
| run: DAPTIN_ENDPOINT=http://localhost:6336 bash scripts/e2e.sh | |
| release: | |
| needs: [test, e2e] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: '~> v2' | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GR_TOKEN }} |