E2E tests #45
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: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| e2e_tests: | |
| strategy: | |
| matrix: | |
| # ref: https://github.com/actions/runner-images | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install vfox (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list | |
| sudo apt-get update | |
| sudo apt-get install vfox | |
| - name: install vfox (MacOS) | |
| if: runner.os == 'MacOS' | |
| run: | | |
| brew tap version-fox/tap | |
| brew install vfox | |
| - name: install scoop (Windows) | |
| if: runner.os == 'Windows' | |
| uses: MinoruSekine/setup-scoop@v3 | |
| - name: install vfox (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| scoop install vfox | |
| - name: add vfox-etcd plugin | |
| if: runner.os == 'Windows' | |
| run: | | |
| vfox add --source https://github.com/version-fox/vfox-etcd/archive/$env:GITHUB_REF.zip etcd | |
| - name: add vfox-etcd plugin | |
| if: runner.os != 'Windows' | |
| run: | | |
| vfox add --source https://github.com/version-fox/vfox-etcd/archive/${GITHUB_REF}.zip etcd | |
| - name: install etcd by vfox-etcd plugin (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| vfox install etcd@3.5.12 | |
| vfox use -g etcd@3.5.12 | |
| eval "$(vfox activate bash)" | |
| echo "===============PATH===============" | |
| echo $PATH | |
| echo "===============PATH===============" | |
| etcd -version | |
| - name: install etcd by vfox-etcd plugin (Darwin) | |
| if: runner.os == 'MacOS' | |
| run: | | |
| vfox install etcd@3.5.12 | |
| vfox use -g etcd@3.5.12 | |
| eval "$(vfox activate bash)" | |
| echo "===============PATH===============" | |
| echo $PATH | |
| echo "===============PATH===============" | |
| etcd -version | |
| - name: install etcd by vfox-etcd plugin (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| vfox install etcd@3.5.12 | |
| vfox use -g etcd@3.5.12 | |
| Invoke-Expression "$(vfox activate pwsh)" | |
| echo "===============PATH===============" | |
| echo $env:PATH | |
| echo "===============PATH===============" | |
| etcd -version | |
| - name: install etcd with failpoint by vfox-etcd plugin (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| export BUILD_WITH_FAILPOINT=yes | |
| vfox install etcd@3.4.32 | |
| vfox use -g etcd@3.4.32 | |
| eval "$(vfox activate bash)" | |
| echo "===============PATH===============" | |
| echo $PATH | |
| echo "===============PATH===============" | |
| etcd -version | |
| export GOFAIL_HTTP="127.0.0.1:22381" | |
| nohup etcd > etcd.log 2>&1 & | |
| sleep 3 | |
| ps auxf | grep etcd | |
| output=$(curl http://127.0.0.1:22381 | grep afterCommit) | |
| if [ -n "$output" ]; then | |
| echo "etcd with failpoint" | |
| echo $output | |
| else | |
| echo "etcd does not with failpoint" | |
| echo $output | |
| exit 1 | |
| fi | |
| - name: install etcd with failpoint by vfox-etcd plugin (MacOS) | |
| if: runner.os == 'MacOS' | |
| run: | | |
| brew install go | |
| export BUILD_WITH_FAILPOINT=yes | |
| vfox install etcd@3.4.32 | |
| vfox use -g etcd@3.4.32 | |
| eval "$(vfox activate bash)" | |
| echo "===============PATH===============" | |
| echo $PATH | |
| echo "===============PATH===============" | |
| etcd -version | |
| export GOFAIL_HTTP="127.0.0.1:22381" | |
| nohup etcd > etcd.log 2>&1 & | |
| sleep 3 | |
| ps -ef | grep etcd | |
| output=$(curl http://127.0.0.1:22381 | grep afterCommit) | |
| if [ -n "$output" ]; then | |
| echo "etcd with failpoint" | |
| echo $output | |
| else | |
| echo "etcd does not with failpoint" | |
| echo $output | |
| exit 1 | |
| fi |