Skip to content

Commit

Permalink
Add EC2 Integration Test on both Darwin and Windows (aws#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhntd authored Apr 12, 2023
1 parent 98c12ac commit 2dd89ab
Show file tree
Hide file tree
Showing 17 changed files with 691 additions and 666 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/PR-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: PR Build
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'NOTICE'
- 'RELEASE_NOTES'
- 'THIRD-PARTY'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/PR-build.yml'

pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- '**/*.md'
- 'NOTICE'
- 'RELEASE_NOTES'
- 'THIRD-PARTY'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/PR-build.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-2019, windows-latest, macos-latest]
include:
- os: ubuntu-latest
family: linux
cache-path: |
~/.cache/go-build
~/go/pkg/mod
- os: macos-latest
family: darwin
cache-path: |
~/Library/Caches/go-build
~/go/pkg/mod
- os: windows-2019
family: windows
cache-path: |
~\AppData\Local\go-build
~\go\pkg\mod
- os: windows-latest
family: windows
cache-path: |
~\AppData\Local\go-build
~\go\pkg\mod
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ~1.19.6
cache: false

- name: Check out code
uses: actions/checkout@v3

- name: Cache binaries
id: cached_binaries
uses: actions/cache@v3
with:
key: "cached-binaries-${{ matrix.os }}-${{ github.sha }}"
path: go.mod

- name: Cache build output
if: steps.cached_binaries.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ${{ matrix.cache-path }}
key: v1-go-pkg-mod-${{ matrix.os }}-${{ hashFiles('**/go.sum') }}

- name: Install make
if: matrix.family == 'windows' && steps.cached_binaries.outputs.cache-hit != 'true'
run: choco install make

- name: Unit Test
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: make test

- name: Upload coverage to Codecov
if: steps.cached_binaries.outputs.cache-hit != 'true'
uses: codecov/codecov-action@v3
with:
verbose: true

- name: Build
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: make amazon-cloudwatch-agent-${{ matrix.family }}

69 changes: 0 additions & 69 deletions .github/workflows/build-test-linux.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/build-test-macos.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/build-test-windows.yml

This file was deleted.

Loading

0 comments on commit 2dd89ab

Please sign in to comment.