Skip to content

Commit

Permalink
Merge pull request #3592 from telepresenceio/thallgren/ci-improvements
Browse files Browse the repository at this point in the history
Update to cater for macos-latest being arm64.
  • Loading branch information
thallgren authored May 5, 2024
2 parents c6cad40 + e03616c commit 3a4c53d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 71 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ jobs:
runners:
- ubuntu-latest
- ubuntu-arm64
- macos-latest
- macos-latest # this runner uses arm64
- windows-2019
- macOS-arm64
clusters:
- distribution: Kubeception
version: "1.27"
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- ubuntu-latest
- ubuntu-arm64
- macos-latest
- macOS-arm64
- windows-2019
runs-on: ${{ matrix.runners }}
steps:
Expand All @@ -37,6 +36,18 @@ jobs:
name: binaries
path: build-output/release
retention-days: 1
- name: generate binaries darwin-amd64 # macos-latest is arm64, so we need an extra amd64 build
if: runner.os == 'macOS'
env:
GOARCH: amd64
run: make clean release-binary
- name: Upload binaries darwin-amd64
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: binaries
path: build-output/release
retention-days: 1
- if: runner.os == 'Linux' && runner.arch == 'X64'
uses: docker/setup-buildx-action@v3
with:
Expand Down
79 changes: 11 additions & 68 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ on:
env:
HOMEBREW_NO_INSTALL_FROM_API:
jobs:
macos:
runs-on: macos-latest
unit:
strategy:
fail-fast: false
matrix:
runners:
- ubuntu-latest
- ubuntu-arm64
- macos-latest
- windows-2019
runs-on: ${{ matrix.runners }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -15,76 +23,11 @@ jobs:
uses: ./.github/actions/install-dependencies
- name: Lint
run: make lint
- name: "Test arm64 build"
run: GOARCH=arm64 make build
- name: "Test amd64 build"
run: make build
- name: Run tests
uses: nick-fields/retry/@v3
with:
max_attempts: 3
timeout_minutes: 12
command: make check-unit

windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- name: install dependencies
uses: ./.github/actions/install-dependencies
- name: Build
run: make build
- name: Lint
run: make lint
- name: Run tests
uses: nick-fields/retry/@v3
with:
max_attempts: 3
timeout_minutes: 12
command: |
make check-unit
linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- name: install dependencies
uses: ./.github/actions/install-dependencies
- name: Lint
run: make lint
- name: "Test amd64 build"
run: make build
- name: Run tests
uses: nick-fields/retry/@v3
with:
max_attempts: 3
timeout_minutes: 10
command: |
make check-unit
linux-arm64:
runs-on: ubuntu-arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- name: install dependencies
uses: ./.github/actions/install-dependencies
- name: Lint
run: make lint
- name: "Test arm64 build"
run: CC=aarch64-linux-gnu-gcc make build
- name: Run tests
uses: nick-fields/retry/@v3
with:
max_attempts: 3
timeout_minutes: 10
command: |
make check-unit
command: make check-unit
4 changes: 4 additions & 0 deletions build-aux/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ $(BUILDDIR)/go1%.src.tar.gz:
mkdir -p $(BUILDDIR)
curl -o $@ --fail -L https://dl.google.com/go/$(@F)

.PHONY: clean
clean:
rm -rf $(BUILDDIR)

.PHONY: protoc-clean
protoc-clean:
find ./rpc -name '*.go' -delete
Expand Down

0 comments on commit 3a4c53d

Please sign in to comment.