Skip to content

Commit be7d420

Browse files
committed
migrate from travis ci to github actions (resolves #8)
1 parent db746e8 commit be7d420

File tree

3 files changed

+56
-12
lines changed

3 files changed

+56
-12
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
name: build
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build-macos:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [macos-12, macos-11]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: build
19+
run: |
20+
swift --version
21+
swift build
22+
build-linux:
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: [ubuntu-20.04, ubuntu-18.04]
27+
swift: [5.6.2, 5.5.3]
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: cache swift toolchains
32+
uses: actions/cache@v2
33+
with:
34+
path: swift-${{ matrix.swift }}.tar.gz
35+
key: ${{ matrix.os }}:swift:${{ matrix.swift }}
36+
37+
- name: cache status
38+
id: cache_status
39+
uses: andstor/file-existence-action@v1
40+
with:
41+
files: swift-${{ matrix.swift }}.tar.gz
42+
43+
- name: download swift toolchain
44+
if: steps.cache_status.outputs.files_exists == 'false'
45+
run: curl https://download.swift.org/swift-${{ matrix.swift }}-release/$(echo ${{ matrix.os }} | sed 's/[^a-zA-Z0-9]//g')/swift-${{ matrix.swift }}-RELEASE/swift-${{ matrix.swift }}-RELEASE-$(echo ${{ matrix.os }} | sed 's/[^a-zA-Z0-9\.]//g').tar.gz --output swift-${{ matrix.swift }}.tar.gz
46+
47+
- name: set up swift
48+
run: |
49+
mkdir -p $GITHUB_WORKSPACE/swift-${{ matrix.swift }}
50+
tar -xzf swift-${{ matrix.swift }}.tar.gz -C $GITHUB_WORKSPACE/swift-${{ matrix.swift }} --strip 1
51+
echo "$GITHUB_WORKSPACE/swift-${{ matrix.swift }}/usr/bin" >> $GITHUB_PATH
52+
- name: build
53+
run: |
54+
swift --version
55+
swift build

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.4
1+
// swift-tools-version:5.5
22

33
import PackageDescription
44

0 commit comments

Comments
 (0)