-
Notifications
You must be signed in to change notification settings - Fork 43
Migrate CI from Cirrus CI to GitHub Actions #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
262d469
2fc8b8e
641d867
0b796b0
533bb80
46f9c32
0001c7d
059b6b6
fd3d772
59d73c6
b1c4683
93fde28
d118199
f3493a4
e82a258
8475ddf
98269e9
564823e
2014909
6cd49ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| merge_group: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| version: v2.12.0 | ||
| only-new-issues: true | ||
|
|
||
| test-linux: | ||
| name: Test (Linux) | ||
| runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Check out Vetu | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: openai/vetu | ||
| path: _vetu | ||
| - name: Build Vetu | ||
| working-directory: _vetu | ||
| run: | | ||
| go build -o "$RUNNER_TEMP/vetu" cmd/vetu/main.go | ||
| sudo setcap cap_net_raw,cap_net_admin+eip "$RUNNER_TEMP/vetu" | ||
| echo "$RUNNER_TEMP" >> "$GITHUB_PATH" | ||
| - name: Pre-pull default Vetu image | ||
| run: vetu pull ghcr.io/cirruslabs/ubuntu-runner-amd64:latest | ||
| - name: Run tests | ||
| run: go test -v -count=1 ./... | ||
|
|
||
| test-macos: | ||
| name: Test (macOS) | ||
| runs-on: ghcr.io/cirruslabs/macos-runner:tahoe | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Pre-pull default Tart image | ||
| run: tart pull ghcr.io/cirruslabs/macos-tahoe-base:latest | ||
| - name: Run tests | ||
| run: go test -timeout=20m -ldflags="-B gobuildid" -v -count=1 ./... | ||
| - name: Clean up test VMs | ||
| if: always() | ||
| run: | | ||
| tart list | ||
| rm -rf ~/.tart/vms/orchard-* | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "*" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release Binaries | ||
| if: github.ref_type == 'tag' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| environment: publish | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Create release app token for this repo | ||
| id: app-token | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | ||
| permission-contents: write | ||
| - name: Create release app token for homebrew-tools | ||
| id: tap-token | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | ||
| owner: openai | ||
| repositories: homebrew-tools | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
| - name: Release | ||
| uses: goreleaser/goreleaser-action@v7 | ||
| with: | ||
| distribution: goreleaser-pro | ||
| version: "~> v2" | ||
| args: release --clean | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
| HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }} | ||
| MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} | ||
| MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} | ||
| MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} | ||
| MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }} | ||
| MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }} | ||
|
|
||
| snapshot: | ||
| name: Release Binaries (Dry Run) | ||
| if: github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Release dry run | ||
| uses: goreleaser/goreleaser-action@v7 | ||
| with: | ||
| distribution: goreleaser-pro | ||
| version: "~> v2" | ||
| args: release --skip=publish --snapshot --clean | ||
| - name: Upload dry-run artifacts | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: orchard-snapshot | ||
| path: dist/** | ||
|
|
||
| docker: | ||
| name: Release Docker Image | ||
| if: github.ref_type == 'tag' | ||
| needs: release | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: docker/setup-qemu-action@v4 | ||
| - uses: docker/setup-buildx-action@v4 | ||
| - uses: docker/login-action@v4 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ github.token }} | ||
| - name: Build and push | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: | | ||
| ghcr.io/openai/orchard:${{ github.ref_name }} | ||
| ghcr.io/openai/orchard:latest | ||
| build-args: | | ||
| VERSION=${{ github.ref_name }} | ||
| COMMIT=${{ github.sha }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,36 +23,15 @@ builds: | |
|
|
||
| archives: | ||
| - id: binary | ||
| format: binary | ||
| formats: | ||
| - binary | ||
| name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" | ||
| - id: regular | ||
| name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" | ||
|
|
||
| release: | ||
| prerelease: auto | ||
|
|
||
| nfpms: | ||
| - package_name: orchard-controller | ||
| vendor: Cirrus Labs, Inc. | ||
| homepage: https://github.com/cirruslabs/orchard | ||
| maintainer: support@cirruslabs.org | ||
| description: Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices | ||
| section: misc | ||
| formats: | ||
| - deb | ||
| - rpm | ||
| contents: | ||
| - src: packaging/orchard-controller.service | ||
| dst: /lib/systemd/system/orchard-controller.service | ||
| type: config | ||
| scripts: | ||
| postinstall: packaging/postinstall.sh | ||
| preremove: packaging/preremove.sh | ||
| postremove: packaging/postremove.sh | ||
|
|
||
| furies: | ||
| - account: cirruslabs | ||
|
|
||
| notarize: | ||
| macos: | ||
| - enabled: '{{ isEnvSet "MACOS_SIGN_P12" }}' | ||
|
|
@@ -66,15 +45,20 @@ notarize: | |
|
|
||
| brews: | ||
| - name: orchard | ||
| directory: Formula | ||
| ids: | ||
| - regular | ||
| repository: | ||
| owner: cirruslabs | ||
| name: homebrew-cli | ||
| owner: openai | ||
| name: homebrew-tools | ||
|
Comment on lines
+63
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This moves formula publishing to Useful? React with 👍 / 👎. |
||
| token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" | ||
| branch: "orchard-{{ .Version }}" | ||
| pull_request: | ||
| enabled: true | ||
| install: | | ||
| bin.install "orchard" | ||
| generate_completions_from_executable(bin/"orchard", "completion") | ||
| caveats: See the Github repository for more information | ||
| homepage: https://github.com/cirruslabs/orchard | ||
| homepage: https://github.com/openai/orchard | ||
| description: Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices | ||
| skip_upload: auto | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the Linux job builds Vetu from source, this
setcapreplaces the old apt-installed package setup but grants onlycap_net_rawandcap_net_admin. Vetu's own install instructions say the binary needscap_net_raw,cap_net_admin,cap_net_bind_service+eip; withoutcap_net_bind_service, the integration tests that later runvetu runcan fail when Vetu binds privileged networking service ports, even though the earliervetu pullstep succeeds.Useful? React with 👍 / 👎.