Skip to content

Commit

Permalink
Merge pull request #127 from eko/github-actions
Browse files Browse the repository at this point in the history
Moved from Travis-ci to Github Actions
  • Loading branch information
eko committed Oct 3, 2021
2 parents c63e59f + 980c7dc commit 42f62da
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 30 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Push on branch

on:
push:
branches:
- '*'

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Run tests
run: cargo test
59 changes: 59 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release tag

on:
push:
tags:
- '*'

jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Create release
id: create
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create.outputs.upload_url }}

build:
name: Build
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: Package asset
run: tar -C target/${{ matrix.target }}/release -czf tado-exporter-${{ matrix.target }}.tar.gz tado-exporter
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./tado-exporter-${{ matrix.target }}.tar.gz
asset_name: tado-exporter-${{ matrix.target }}.tar.gz
asset_content_type: application/octet-stream
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tado° Prometheus Exporter

[![TravisBuildStatus](https://api.travis-ci.org/eko/tado-exporter.svg?branch=master)](https://travis-ci.org/eko/tado-exporter)
[![Push on branch](https://github.com/eko/tado-exporter/actions/workflows/master.yml/badge.svg)](https://github.com/eko/tado-exporter/actions/workflows/master.yml)

This is a Prometheus exporter for [tado°](https://www.tado.com/) thermostatic handles.

Expand Down

0 comments on commit 42f62da

Please sign in to comment.