forked from swiftwasm/carton
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.3 KB
/
swift.yml
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
name: Build and test
on:
push:
branches: [main]
pull_request:
branches: "*"
jobs:
swift-test:
strategy:
matrix:
include:
- os: macos-12
swift_version: 5.7
xcode: /Applications/Xcode_14.0.app/Contents/Developer
- os: macos-12
swift_version: 5.6
xcode: /Applications/Xcode_13.4.app/Contents/Developer
- os: macos-11
swift_version: 5.5
xcode: /Applications/Xcode_13.2.1.app/Contents/Developer
- os: ubuntu-20.04
swift_version: 5.6
- os: ubuntu-20.04
swift_version: 5.7
name: Build on ${{ matrix.os }} with Swift ${{ matrix.swift_version }}
timeout-minutes: 40
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Select Xcode version
if: startsWith(matrix.os, 'macos')
run: sudo xcode-select --switch ${{ matrix.xcode }}
- name: Cleanup pre-installed SwiftLint
run: rm -f '/usr/local/bin/swiftlint'
- name: Install dependencies for macOS
run: brew bundle
if: startsWith(matrix.os, 'macos')
- name: Install dependencies for Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo ./install_ubuntu_deps.sh
curl https://get.wasmer.io -sSfL | sh
- name: Build the project
run: |
swift -v
swift build -Xswiftc -Xfrontend -Xswiftc -validate-tbd-against-ir=none
- name: Build and install JavaScript and sanitizer resources
run: |
set -ex
npm install
swift run carton-release hash-archive
mkdir -p $HOME/.carton
cp -r static $HOME/.carton
- name: Run Tests
run: |
set -ex
if [ -e /home/runner/.wasmer/wasmer.sh ]; then
source /home/runner/.wasmer/wasmer.sh
fi
swift test -Xswiftc -Xfrontend -Xswiftc -validate-tbd-against-ir=none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker_image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build a Docker image on Ubuntu 20.04
run: docker build . -t ghcr.io/swiftwasm/swiftwasm-action:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}