Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
Merge 2e80b44 into 79cf618
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed May 5, 2022
2 parents 79cf618 + 2e80b44 commit 03164e5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 50 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea
/target
/tiles
/tiles
66 changes: 17 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Lint, test, and publish
name: Lint and test

on:
push:
branches:
- develop
release:
types: [published]
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
if: github.event_name != 'release'
strategy:
matrix:
rust:
Expand All @@ -25,11 +23,22 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
- name: Formatting (fmt)
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
coverage_and_publish:

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -49,44 +58,3 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
path-to-lcov: './lcov.info'
- name: Publish to crates.io
if: github.event_name == 'release'
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_TOKEN }}

fmt:
name: Rustfmt
runs-on: ubuntu-latest
if: github.event_name != 'release'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'release'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to crates.io

on:
release:
types: [published]

jobs:

coverage_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# TODO: On publish, do we need to run these two coverage steps?
- name: Generate coverage info
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.18.0'
args: '-- --test-threads 1'
out-type: 'Lcov'
- name: Upload to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
path-to-lcov: './lcov.info'
- name: Publish to crates.io
if: github.event_name == 'release'
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea
/target
**/*.rs.bk

Expand Down

0 comments on commit 03164e5

Please sign in to comment.