|
15 | 15 | runs-on: ${{ matrix.os }} |
16 | 16 | strategy: |
17 | 17 | matrix: |
18 | | - os: [ ubuntu-latest ] |
19 | | - python: [ 3.6, 3.7, 3.8, 3.9 ] |
| 18 | + os: [ ubuntu-latest, macos-latest ] |
| 19 | + python: [ 3.7, 3.8, 3.9 ] |
20 | 20 | node: [ 14 ] |
21 | 21 | env: |
22 | 22 | SAM_CLI_TELEMETRY: "0" |
|
26 | 26 | AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" |
27 | 27 | LOG_PATH: /tmp/debug-logs |
28 | 28 | PIP_LOG_FILE: /tmp/pip.log |
| 29 | + HOMEBREW_NO_AUTO_UPDATE: 1 |
29 | 30 | steps: |
30 | 31 | - uses: actions/checkout@v3 |
| 32 | + - name: Update Homebrew and save docker version |
| 33 | + if: runner.os == 'macOS' |
| 34 | + run: | |
| 35 | + brew update --preinstall |
| 36 | + cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/docker.rb" > .github/brew-formulae |
| 37 | + - name: Configure Homebrew docker cache files |
| 38 | + uses: actions/cache@v3 |
| 39 | + if: runner.os == 'macOS' |
| 40 | + with: |
| 41 | + path: | |
| 42 | + ~/Library/Caches/Homebrew/docker--* |
| 43 | + ~/Library/Caches/Homebrew/downloads/*--docker-* |
| 44 | + key: brew-${{ hashFiles('.github/brew-formulae') }} |
| 45 | + restore-keys: brew- |
| 46 | + - name: Install Docker if on MacOS and start colima |
| 47 | + id: install_mac_docker |
| 48 | + if: runner.os == 'macOS' |
| 49 | + run: | |
| 50 | + brew install docker |
| 51 | + # Docker engine is no longer available because of licensing |
| 52 | + # Alternative Colima is part of the github macOS runner |
| 53 | + # SAM v1.47.0+ needed for colima support, unable to use Python 3.6 |
| 54 | + colima start |
| 55 | + # Ensure colima is configured for later user |
| 56 | + echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV |
| 57 | + # Verify Docker |
| 58 | + docker ps |
| 59 | + docker --version |
| 60 | + # Verify colima |
| 61 | + colima status |
31 | 62 | - uses: actions/setup-python@v4 |
32 | 63 | with: |
33 | 64 | python-version: ${{ matrix.python }} |
@@ -75,11 +106,12 @@ jobs: |
75 | 106 | run: | |
76 | 107 | RPDK_PACKAGE=$(npm pack --silent) |
77 | 108 | RPDK_PATH=$PWD/$RPDK_PACKAGE |
78 | | - DIR=$(mktemp -d) |
| 109 | + DIR=TestCI |
| 110 | + mkdir $DIR |
79 | 111 | cd "$DIR" |
80 | | - echo "PROJECT_DIR=$DIR" >> $GITHUB_ENV |
| 112 | + echo "PROJECT_DIR=$PWD" >> $GITHUB_ENV |
81 | 113 | ls -la |
82 | | - printf "n" | cfn init -vv --artifact-type RESOURCE --type-name AWS::Foo::Bar |
| 114 | + printf "n" | cfn init -vv --artifact-type RESOURCE --type-name AWS::Foo::Bar typescript |
83 | 115 | ls -la |
84 | 116 | mkdir ./dist |
85 | 117 | cp "$RPDK_PATH" ./dist |
|
88 | 120 | npm install --include=optional |
89 | 121 | sam build --debug --build-dir ./build TypeFunction |
90 | 122 | sam build --debug --build-dir ./build TestEntrypoint |
91 | | - sam local invoke -t build/template.yaml --debug --event sam-tests/create.json --log-file sam.log TestEntrypoint |
| 123 | + sam local invoke -t ./build/template.yaml --debug --event ./sam-tests/create.json --log-file ./sam.log TestEntrypoint |
92 | 124 | grep -q '"status":"SUCCESS"' sam.log |
93 | 125 | - name: Gather Debug Logs |
94 | 126 | id: gather_logs |
|
0 commit comments