This repository was archived by the owner on Jul 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (95 loc) · 2.93 KB
/
Copy pathci.yaml
File metadata and controls
98 lines (95 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
"Build-Examples":
runs-on: ubuntu-18.04
strategy:
matrix:
example:
- EventSources
- SquareNumber
- TodoAPIGateway
- URLRequestWithSession
env:
SWIFT_VERSION: 5.2.1
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install ruby
uses: actions/setup-ruby@v1
- name: Build Docker Swift Dev Image
run: docker build --build-arg SWIFT_VERSION=${SWIFT_VERSION} -t fabianfett/amazonlinux-swift:${SWIFT_VERSION}-amazonlinux2-dev ./docker
- name: Build example
run: |
cd examples/${{ matrix.example }}
make package_lambda
- name: Install sam cli
if: matrix.example == 'SquareNumber'
run: sudo pip install aws-sam-cli
- name: Download layer
if: matrix.example == 'SquareNumber'
run: |
cd examples/${{ matrix.example }}
make download_layer
- name: Run example
if: matrix.example == 'SquareNumber'
run: |
cd examples/${{ matrix.example }}
echo '{"number": 9 }' | sam local invoke -v . "SquareNumberFunction"
echo '{"number": 3 }' | sam local invoke -v . "PrintNumberFunction"
"tuxOS-Tests":
runs-on: ubuntu-latest
strategy:
matrix:
images:
- swift:5.1.5
- swift:5.2.1
container:
image: ${{ matrix.images }}
volumes:
- /workspace:/src
options: --workdir /src
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install dependencies
run: apt-get update && apt-get install -y zlib1g-dev zip openssl libssl-dev
- name: Test
run: swift test --enable-code-coverage --enable-test-discovery
- name: Convert coverage files
run: llvm-cov export -format="lcov" .build/debug/swift-lambda-runtimePackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
"macOS-Tests":
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Show all Xcode versions
run: ls -an /Applications/ | grep Xcode*
- name: Change Xcode command line tools
run: sudo xcode-select -s /Applications/Xcode_11.4.app/Contents/Developer
- name: SPM Build
run: swift build
- name: SPM Tests
run: swift test --parallel -Xswiftc -DDEBUG
- name: Xcode Tests
run: |
swift package generate-xcodeproj
xcodebuild -quiet -parallel-testing-enabled YES -scheme swift-lambda-runtime-Package -enableCodeCoverage YES build test
- name: Codecov
run: bash <(curl -s https://codecov.io/bash) -J 'LambdaRuntime' -t ${{secrets.CODECOV_TOKEN}}