Skip to content

Commit

Permalink
Migrate CI to Github Actions (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-zen authored Jan 16, 2022
1 parent fc68464 commit 4f2cd65
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 198 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy

on:
push:
tags: [ "*" ]

jobs:
docs:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1

- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc

- name: Override index.html
run: |
REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)
echo "<meta http-equiv=refresh content=0;url=${REPO_NAME}/index.html>" > target/doc/index.html
- name: Publish into Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc

- name: Login into crates.io
run: cargo login ${CRATES_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_TOKEN }}
- name: Publish into crates.io
run: cargo publish

37 changes: 37 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [1.51.0]
os: [macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

8 changes: 0 additions & 8 deletions ci/build-docs.sh

This file was deleted.

8 changes: 0 additions & 8 deletions ci/publish.sh

This file was deleted.

7 changes: 0 additions & 7 deletions ci/update-version.sh

This file was deleted.

Loading

0 comments on commit 4f2cd65

Please sign in to comment.