Skip to content
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

ci: run e2e test for macOS #1138

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
42 changes: 29 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
branches:
- main
paths:
- '.github/workflows/**'
- '**.go'
- 'Makefile'
- 'go.**'
- ".github/workflows/**"
- "**.go"
- "Makefile"
- "go.**"
pull_request:
paths:
- '.github/workflows/**'
- '**.go'
- 'Makefile'
- 'go.**'
- ".github/workflows/**"
- "**.go"
- "Makefile"
- "go.**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -92,11 +92,19 @@ jobs:
ENVD_ANALYTICS: false
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up docker
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install docker
colima start --cpu 3 --memory 14
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -110,7 +118,7 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions-ecosystem/action-get-latest-tag@v1
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
- name: e2e test
run: make e2e-cli-test
Expand All @@ -128,11 +136,19 @@ jobs:
ENVD_ANALYTICS: false
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up docker
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install docker
colima start --cpu 3 --memory 14
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -146,7 +162,7 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions-ecosystem/action-get-latest-tag@v1
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
- name: e2e test
run: make e2e-lang-test
Expand Down Expand Up @@ -207,7 +223,7 @@ jobs:
with:
name: coverage-out
path: merge

- name: Get cli e2e coverage report
uses: actions/download-artifact@v3
with:
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: nightly

on:
schedule:
- cron: '0 2 * * *' # UTC 2:00 every day
- cron: "0 2 * * *" # UTC 2:00 every day
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
ENVD_ANALYTICS: false
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
Expand Down Expand Up @@ -82,11 +82,19 @@ jobs:
ENVD_ANALYTICS: false
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up docker
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install docker
colima start --cpu 3 --memory 14
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -100,7 +108,7 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions-ecosystem/action-get-latest-tag@v1
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
- name: e2e test
run: make e2e-cli-test
Expand All @@ -118,11 +126,19 @@ jobs:
ENVD_ANALYTICS: false
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up docker
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install docker
colima start --cpu 3 --memory 14
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -136,7 +152,7 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions-ecosystem/action-get-latest-tag@v1
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
- name: e2e test
run: make e2e-lang-test
Expand Down Expand Up @@ -190,7 +206,7 @@ jobs:
name: build
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ e2e-cli-test:
-X $(ROOT)/pkg/version.gitTreeState=$(GIT_TREE_STATE) \
-X $(ROOT)/pkg/version.gitTag="$(shell git describe --tags --abbrev=0)" \
-X $(ROOT)/pkg/version.developmentFlag=true" \
-race -v -timeout 20m -coverpkg=./pkg/... -coverprofile=e2e-cli-coverage.out ./e2e/cli
-race -v -timeout 30m -coverpkg=./pkg/... -coverprofile=e2e-cli-coverage.out ./e2e/cli


e2e-lang-test:
@go test -ldflags "-s -w -X $(ROOT)/pkg/version.version=$(VERSION) \
Expand All @@ -202,7 +203,7 @@ e2e-lang-test:
-X $(ROOT)/pkg/version.gitTreeState=$(GIT_TREE_STATE) \
-X $(ROOT)/pkg/version.gitTag="$(shell git describe --tags --abbrev=0)" \
-X $(ROOT)/pkg/version.developmentFlag=true" \
-race -v -timeout 20m -coverpkg=./pkg/... -coverprofile=e2e-lang-coverage.out ./e2e/language
-race -v -timeout 30m -coverpkg=./pkg/... -coverprofile=e2e-lang-coverage.out ./e2e/language

e2e-doc-test:
@go test -ldflags "-s -w -X $(ROOT)/pkg/version.version=$(VERSION) \
Expand Down