-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit 3962275
Showing
15 changed files
with
866 additions
and
0 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,76 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test: | ||
name: Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
lints: | ||
name: Lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- 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 |
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,79 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
name: Create Github Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Output Release URL File | ||
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | ||
|
||
- name: Save Release URL File for publish | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: release_url | ||
path: release_url.txt | ||
|
||
publish: | ||
needs: [release] | ||
name: Build for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
artifact_name: d | ||
asset_name: d-linux-amd64 | ||
- os: macos-latest | ||
artifact_name: d | ||
asset_name: d-macos-amd64 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --release --locked | ||
|
||
- name: Generate assets | ||
run: | | ||
tar -cvzf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}.sh -C target/release ${{ matrix.artifact_name }} | ||
- name: Load Release URL File from release job | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: release_url | ||
|
||
- name: Get Release File Name & Upload URL | ||
id: get_release_info | ||
run: | | ||
value=`cat release_url/release_url.txt` | ||
echo ::set-output name=upload_url::$value | ||
env: | ||
TAG_REF_NAME: ${{ github.ref }} | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./${{ matrix.asset_name }}.tar.gz | ||
asset_name: ${{ matrix.asset_name }}.tar.gz | ||
asset_content_type: application/tar+gzip |
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 @@ | ||
/target |
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,4 @@ | ||
{ | ||
"editor.defaultFormatter": "rust-lang.rust", | ||
"editor.formatOnSave": true | ||
} |
Oops, something went wrong.