Add e2e test config #52
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: E2E Tests | |
| on: | |
| push: | |
| branches: [ '*' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| jobs: | |
| e2e-tests: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Get branch name | |
| id: branch-name | |
| run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Use go get with current branch if not master | |
| run: | | |
| BRANCH_NAME="${{ steps.branch-name.outputs.branch }}" | |
| if [ "$BRANCH_NAME" != "master" ]; then | |
| go get github.com/fumiya-kume/mdefaults@$BRANCH_NAME | |
| fi | |
| - name: Build | |
| run: go build -o mdefaults ./cmd/mdefaults | |
| - name: Run E2E Tests | |
| run: | | |
| go run ./test/e2e/run_tests.go --verbose |