-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature(ci): Copy workflows from stronghold and adapt for identity.rs * fix(ci): Use main instead of master for branch trigger * feature(ci): Build and test on Windows as well * fix(ci): Remove toolchain from cache keys
- Loading branch information
1 parent
8dc6cf7
commit ce99390
Showing
5 changed files
with
173 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,26 @@ | ||
name: Audit | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**/Cargo.lock" | ||
- "**/Cargo.toml" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "**/Cargo.lock" | ||
- "**/Cargo.toml" | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,80 @@ | ||
name: Build and run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
paths-ignore: | ||
- 'docs/**' | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [identity_account, identity_communication, identity_doc_manager, identity_integration, identity_resolver, identity_schema, identity_vc] | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Get current date | ||
if: matrix.os == 'ubuntu-latest' | ||
run: echo "::set-env name=CURRENT_DATE::$(date +'%Y-%m-%d')" | ||
|
||
- name: Get current date | ||
if: matrix.os == 'windows-latest' | ||
run: echo "::set-env name=CURRENT_DATE::$(Get-Date -Format "yyyy-MM-dd")" | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/registry | ||
# Add date to the cache to keep it up to date | ||
key: ${{ matrix.project }}-${{ matrix.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }} | ||
# Restore from outdated cache for speed | ||
restore-keys: | | ||
${{ matrix.project }}-${{ matrix.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/git | ||
# Add date to the cache to keep it up to date | ||
key: ${{ matrix.project }}-${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }} | ||
# Restore from outdated cache for speed | ||
restore-keys: | | ||
${{ matrix.project }}-${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Cache cargo target | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ matrix.project}}/target | ||
# Add date to the cache to keep it up to date | ||
key: ${{ matrix.project }}-${{ matrix.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }} | ||
# Restore from outdated cache for speed | ||
restore-keys: | | ||
${{ matrix.project }}-${{ matrix.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Build ${{ matrix.project }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --manifest-path=${{ matrix.project }}/Cargo.toml --all --release | ||
|
||
- name: Run tests for ${{ matrix.project }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --manifest-path=${{ matrix.project }}/Cargo.toml --all --release |
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,33 @@ | ||
name: Clippy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [identity_account, identity_communication, identity_doc_manager, identity_integration, identity_resolver, identity_schema, identity_vc] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install clippy with stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: clippy | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --manifest-path=${{ matrix.project }}/Cargo.toml --all-targets --all-features -- -D warnings | ||
name: clippy-${{ matrix.project }} |
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,32 @@ | ||
name: Format | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [identity_account, identity_communication, identity_doc_manager, identity_integration, identity_resolver, identity_schema, identity_vc] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rustfmt with nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --manifest-path=${{ matrix.project }}/Cargo.toml --all -- --check |