-
Notifications
You must be signed in to change notification settings - Fork 50
59 lines (46 loc) · 2.1 KB
/
test.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
name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
test:
strategy:
matrix:
# Use windows-2019, which is a lot faster than windows-2022:
# https://github.com/actions/runner-images/issues/5166
os: [ubuntu-latest, macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
env:
OUTPUT_DIR: ${{ github.workspace }}/out
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: '${{ github.workspace }}/go.mod'
- name: Build SDK
run: go build -v ./...
- name: Build X
run: go build -C x -o "${{ env.OUTPUT_DIR }}/" -v ./...
- name: Build Go Mobile
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: go build -C x -o "${{ env.OUTPUT_DIR }}/" golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind
- name: Build Mobileproxy (Android)
if: matrix.os == 'ubuntu-latest'
run: PATH="${{ env.OUTPUT_DIR }}:$PATH" gomobile bind -ldflags='-s -w' -v -target=android -androidapi=21 -o "${{ env.OUTPUT_DIR }}/mobileproxy.aar" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy
working-directory: ${{ github.workspace }}/x
- name: Build Mobileproxy (iOS)
if: matrix.os == 'macos-latest'
run: PATH="${{ env.OUTPUT_DIR }}:$PATH" gomobile bind -ldflags='-s -w' -v -target=ios -iosversion=11.0 -o "${{ env.OUTPUT_DIR }}/mobileproxy.xcframework" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy
working-directory: ${{ github.workspace }}/x
- name: Test SDK
# Enable nettests, which executes external network requests.
run: go test -v -race -bench '.' ./... -benchtime=100ms -tags nettest
- name: Test X
# Enable nettests, which executes external network requests.
run: go test -C x -v -race -bench '.' ./... -benchtime=100ms -tags nettest