-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
2 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,44 @@ | ||
name: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
name: test | ||
runs-on: "ubuntu-latest" | ||
env: | ||
TARGET_DIR: ./target | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: "checkout code" | ||
uses: actions/checkout@v2 | ||
- name: "install rust" | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- name: "build application" | ||
run: cargo build --verbose | ||
- name: "run tests" | ||
run: make test-unit | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "checkout code" | ||
uses: actions/checkout@v2 | ||
- name: "install rust" | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
components: rustfmt | ||
- name: "check formatting" | ||
run: make test-style | ||
- name: "check linting" | ||
run: make test-lint |
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,35 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
jobs: | ||
build: | ||
name: "build release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "checkout code" | ||
uses: actions/checkout@v2 | ||
- name: "install rust" | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- name: "build application" | ||
run: VERSION=${{ github.ref_name }} cargo build --verbose --release | ||
- name: "get github release metadata" | ||
id: get_release | ||
uses: bruceadams/get-release@v1.2.1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: "upload release to github" | ||
uses: actions/upload-release-asset@v1 | ||
id: upload_release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
asset_path: ./target/release/ipcalc | ||
asset_name: ipcalc-linux-amd64-${{ github.ref_name }} | ||
asset_content_type: application/octet-stream |
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