This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
generated from hack-ink/rust-initializer
-
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.
Signed-off-by: Xavier Lau <[email protected]>
- Loading branch information
Showing
23 changed files
with
3,167 additions
and
212 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 |
---|---|---|
|
@@ -8,34 +8,24 @@ on: | |
- main | ||
|
||
env: | ||
CARGO_INCREMENTAL: 1 | ||
CARGO_TERM_COLOR: always | ||
|
||
GITHUB_CACHE_VERSION: 1 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
RUST_BACKTRACE: full | ||
RUSTC_WRAPPER: sccache | ||
|
||
SCCACHE_LINK: https://github.com/mozilla/sccache/releases/download | ||
SCCACHE_VERSION: v0.3.0 | ||
SCCACHE_DIR: /home/runner/.cache/sccache | ||
|
||
jobs: | ||
cargo_checks: | ||
cargo-checks: | ||
name: Task cargo ${{ matrix.action }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
action: [clippy, nextest] | ||
action: [clippy, fmt, nextest] | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
- name: Install Sccache | ||
run: | | ||
export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl | ||
curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz | ||
sudo mv $SCCACHE_FILE/sccache /usr/bin | ||
sudo chmod u+x /usr/bin/sccache | ||
- name: Cache cargo | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -45,24 +35,25 @@ jobs: | |
target | ||
key: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}- | ||
- name: Cache sccache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.SCCACHE_DIR}} | ||
key: sccache-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}--${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: sccache-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}- | ||
- name: Cargo ${{ matrix.action }} | ||
if: matrix.action == 'clippy' | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --workspace --all-features --all-targets --locked | ||
- name: Cargo ${{ matrix.action }} | ||
if: matrix.action == 'fmt' | ||
run: cargo ${{ matrix.action }} --all -- --check | ||
- name: Install cargo-nextest | ||
if: matrix.action == 'nextest' | ||
uses: taiki-e/install-action@nextest | ||
- name: Cargo nextest | ||
- name: Cargo ${{ matrix.action }} | ||
if: matrix.action == 'nextest' | ||
uses: actions-rs/cargo@v1 | ||
run: cargo ${{ matrix.action }} run --release --workspace --all-features --all-targets --locked | ||
- name: Fast fail | ||
uses: vishnudxb/[email protected] | ||
if: failure() | ||
with: | ||
command: nextest | ||
args: run --workspace --all-features --all-targets --locked | ||
repo: hack-ink/subapeye | ||
workflow_id: ${{ github.run_id }} | ||
access_token: ${{ github.token }} |
File renamed without changes.
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 |
---|---|---|
|
@@ -8,88 +8,24 @@ env: | |
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
name: Build ${{ matrix.target.name }} package | ||
runs-on: ${{ matrix.target.os }} | ||
strategy: | ||
matrix: | ||
target: | ||
[ | ||
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest }, | ||
{ name: aarch64-apple-darwin, os: macos-latest }, | ||
{ name: x86_64-apple-darwin, os: macos-latest }, | ||
{ | ||
name: x86_64-pc-windows-msvc, | ||
os: windows-latest, | ||
extension: .exe, | ||
}, | ||
] | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain | ||
run: rustup target add ${{ matrix.target.name }} | ||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --locked --target ${{ matrix.target.name }} | ||
- name: Compress | ||
run: | | ||
mv target/${{ matrix.target.name }}/release/<NAME>${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }} | ||
- name: Collect artifact | ||
run: | | ||
mkdir -p artifacts | ||
mv <NAME>-${{ matrix.target.name }}.zst artifacts | ||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
- name: Hash | ||
run: | | ||
cd artifacts | ||
sha256sum * | tee ../SHA256 | ||
md5sum * | tee ../MD5 | ||
mv ../SHA256 . | ||
mv ../MD5 . | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
discussion_category_name: Announcements | ||
generate_release_notes: true | ||
files: artifacts/* | ||
|
||
# publish-on-crates-io: | ||
# name: Publish on crates.io | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Fetch latest code | ||
# uses: actions/checkout@v3 | ||
# - name: Login | ||
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
# - name: Publish | ||
# run: .maintain/release.sh | ||
|
||
clean-artifacts: | ||
name: Clean artifacts | ||
if: always() | ||
needs: [release] | ||
steps: | ||
- name: Clean artifacts | ||
uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: artifacts | ||
publish-on-crates-io: | ||
name: Publish on crates.io | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
- name: Login | ||
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
- name: Publish | ||
run: cargo publish --locked |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.