Skip to content

Commit

Permalink
Switch from travis to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Sep 12, 2019
1 parent bb79b03 commit b907b5d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 67 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
push:
branches:
pull_request:

jobs:
build:
name: Build ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]

steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v1
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
push:
tags:
- '*.*.*'

jobs:
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# This should work with only the `include`s but it currently doesn't because of this bug:
# https://github.saobby.my.eu.orgmunity/t5/How-to-use-Git-and-GitHub/GitHub-Actions-Matrix-options-dont-work-as-documented/td-p/29558
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: dummyhttp
release_name: dummyhttp-linux-amd64
- os: windows-latest
artifact_name: dummyhttp.exe
release_name: dummyhttp-windows-amd64.exe
- os: macos-latest
artifact_name: dummyhttp
release_name: dummyhttp-macos-amd64

steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cargo build --release --locked
- uses: svenstaro/upx-action@v1-release
with:
file: target/release/${{ matrix.artifact_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.release_name }}
tag: ${{ github.ref }}
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

0 comments on commit b907b5d

Please sign in to comment.