Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python: [ 3.6, 3.7, 3.8, 3.9 ]
os: [ ubuntu-latest, macos-latest ]
python: [ 3.7, 3.8, 3.9 ]
node: [ 14 ]
env:
SAM_CLI_TELEMETRY: "0"
Expand All @@ -26,8 +26,39 @@ jobs:
AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
LOG_PATH: /tmp/debug-logs
PIP_LOG_FILE: /tmp/pip.log
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v3
- name: Update Homebrew and save docker version
if: runner.os == 'macOS'
run: |
brew update --preinstall
cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/docker.rb" > .github/brew-formulae
- name: Configure Homebrew docker cache files
uses: actions/cache@v3
if: runner.os == 'macOS'
with:
path: |
~/Library/Caches/Homebrew/docker--*
~/Library/Caches/Homebrew/downloads/*--docker-*
key: brew-${{ hashFiles('.github/brew-formulae') }}
restore-keys: brew-
- name: Install Docker if on MacOS and start colima
id: install_mac_docker
if: runner.os == 'macOS'
run: |
brew install docker
# Docker engine is no longer available because of licensing
# Alternative Colima is part of the github macOS runner
# SAM v1.47.0+ needed for colima support, unable to use Python 3.6
colima start
# Ensure colima is configured for later user
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
# Verify Docker
docker ps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hows this verify docker? Seems like extra and for logging purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to do a docker CLI to server connection check.
docker info
docker version

would also be options that fail if docker CLI cannot connect with the backend. Though those are more verbose.

docker --version
# Verify colima
colima status
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -75,11 +106,12 @@ jobs:
run: |
RPDK_PACKAGE=$(npm pack --silent)
RPDK_PATH=$PWD/$RPDK_PACKAGE
DIR=$(mktemp -d)
DIR=TestCI
mkdir $DIR
cd "$DIR"
echo "PROJECT_DIR=$DIR" >> $GITHUB_ENV
echo "PROJECT_DIR=$PWD" >> $GITHUB_ENV
ls -la
printf "n" | cfn init -vv --artifact-type RESOURCE --type-name AWS::Foo::Bar
printf "n" | cfn init -vv --artifact-type RESOURCE --type-name AWS::Foo::Bar typescript
ls -la
mkdir ./dist
cp "$RPDK_PATH" ./dist
Expand All @@ -88,7 +120,7 @@ jobs:
npm install --include=optional
sam build --debug --build-dir ./build TypeFunction
sam build --debug --build-dir ./build TestEntrypoint
sam local invoke -t build/template.yaml --debug --event sam-tests/create.json --log-file sam.log TestEntrypoint
sam local invoke -t ./build/template.yaml --debug --event ./sam-tests/create.json --log-file ./sam.log TestEntrypoint
grep -q '"status":"SUCCESS"' sam.log
- name: Gather Debug Logs
id: gather_logs
Expand Down