-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: switch to reusable workflows (#168)
* chore: switch to reusable workflows in CI * Typo
- Loading branch information
Showing
8 changed files
with
198 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build and Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
rust: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-and-test: | ||
name: '${{ inputs.os }}, ${{ inputs.rust }}' | ||
runs-on: ${{ inputs.os }} | ||
# Unfortunately, we can't do this right now because `indexmap` does not seem to follow semver. | ||
# env: | ||
# RUSTFLAGS: -D warnings -D missing-docs | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install protoc (Ubuntu) | ||
if: contains(inputs.os, 'ubuntu') | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y protobuf-compiler | ||
- name: Install protoc (macOS) | ||
if: contains(inputs.os, 'macos') | ||
run: brew install protobuf | ||
|
||
- name: Install protoc (Windows) | ||
if: contains(inputs.os, 'windows') | ||
run: choco install protoc | ||
|
||
- name: Install Rust (${{ inputs.rust }}) | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ inputs.rust }} | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Build with all features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-build-all | ||
|
||
- name: Build with INX only | ||
if: contains(inputs.os, 'ubuntu') | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-build-inx | ||
|
||
- name: Build with API only | ||
if: contains(inputs.os, 'ubuntu') | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-build-api | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-test | ||
|
||
- name: Doc Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-doctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Check Clippy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
rust: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
clippy: | ||
name: '${{inputs.os}}, ${{inputs.rust}}' | ||
runs-on: ${{inputs.os}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{inputs.rust}} | ||
override: true | ||
components: clippy | ||
|
||
- name: Clippy with all features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-clippy-all | ||
|
||
- name: Clippy with INX only | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-clippy-inx | ||
|
||
- name: Clippy with API only | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-clippy-api |
10 changes: 4 additions & 6 deletions
10
.github/workflows/build_docker.yml → .github/workflows/_docker.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check Formatting | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
rust: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
format: | ||
name: '${{inputs.os}}, ${{inputs.rust}}' | ||
runs-on: ${{ inputs.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ inputs.rust }} | ||
override: true | ||
components: rustfmt | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: ci-fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Build Docker | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "docker/Dockerfile" | ||
- "docker/docker-compose.yml" | ||
|
||
jobs: | ||
docker: | ||
uses: ./.github/workflows/_docker.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters