chore: run e2e in finch vm #1
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: macOS Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| workflow_dispatch: | |
| env: | |
| GO_VERSION: '1.23.8' | |
| jobs: | |
| mac-test: | |
| runs-on: codebuild-Test-fd-codebuild-mac-${{ github.run_id }}-${{ github.run_attempt }} | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Clean macOS runner workspace | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| # We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail. | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| submodules: recursive | |
| - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: false | |
| - name: Clean up previous files | |
| run: | | |
| sudo rm -rf /opt/finch | |
| sudo rm -rf ~/.finch | |
| sudo rm -rf ./_output | |
| if pgrep '^qemu-system'; then | |
| sudo pkill '^qemu-system' | |
| fi | |
| if pgrep '^socket_vmnet'; then | |
| sudo pkill '^socket_vmnet' | |
| fi | |
| - name: Install Rosetta 2 | |
| run: echo "A" | softwareupdate --install-rosetta || true | |
| - run: brew install lz4 automake autoconf libtool yq | |
| shell: zsh {0} | |
| # Install Finch | |
| - name: Install Finch | |
| run: brew install finch | |
| shell: zsh {0} | |
| # Initialize and start Finch VM | |
| - name: Initialize Finch VM | |
| run: finch vm init | |
| - name: Start Finch VM | |
| run: finch vm start | |
| # Run e2e tests inside the Finch VM | |
| - name: Run e2e tests | |
| run: DOCKER_HOST=unix:///Applications/Finch/lima/data/finch/sock/finch.sock make test-e2e | |
| # Run e2e tests with OPA authorization | |
| - name: Run opa e2e tests | |
| run: DOCKER_HOST=unix:///Applications/Finch/lima/data/finch/sock/finch.sock make test-e2e-opa | |
| # Cleanup | |
| - name: Stop Finch VM | |
| run: finch vm stop | |
| if: always() |