Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated actions #132

Merged
merged 3 commits into from
Jan 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 97 additions & 114 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Indy-VDR'
name: "Indy-VDR"

on:
push:
Expand All @@ -10,12 +10,12 @@ on:
workflow_dispatch:
inputs:
publish-binaries:
description: 'Publish Binaries to Release (will create a release if no release exits for branch or tag)'
description: "Publish Binaries to Release (will create a release if no release exits for branch or tag)"
required: true
default: false
type: boolean
publish-wrappers:
description: 'Publish Wrappers to Registries'
description: "Publish Wrappers to Registries"
required: true
default: false
type: boolean
Expand All @@ -39,21 +39,13 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check

- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Debug build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path libindy_vdr/Cargo.toml --features zmq_vendored
run: cargo build --manifest-path libindy_vdr/Cargo.toml --features zmq_vendored

test-suite:
name: Run Test Suite
Expand All @@ -69,17 +61,14 @@ jobs:
- name: Cache cargo resources
uses: Swatinem/rust-cache@v2

- name: Run node pool
- name: Run local node pool
run: |
docker build -f ci/indy-pool.dockerfile -t test_pool --build-arg pool_ip=10.0.0.2 ci
docker network create --subnet=10.0.0.0/8 indy-sdk-network
docker run -d --name indy_pool -p 9701-9708:9701-9708 --net=indy-sdk-network test_pool

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path libindy_vdr/Cargo.toml --features local_nodes_pool
run: cargo test --manifest-path libindy_vdr/Cargo.toml --features local_nodes_pool

build-release:
name: Build Library
Expand Down Expand Up @@ -135,11 +124,9 @@ jobs:

- if: matrix.use_cross
name: Build library (cross)
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --lib --release --target ${{ matrix.target }} --features zmq_vendored
run: |
cargo install --bins --git https://github.com/rust-embedded/cross --tag v0.2.4 cross
cross build --lib --release --target ${{ matrix.target }} --features zmq_vendored

- name: Upload library artifacts
uses: actions/upload-artifact@v3
Expand All @@ -163,7 +150,7 @@ jobs:
command: c
cwd: release-artifacts
files: .
outPath: 'library-${{ matrix.arch }}.tar.gz'
outPath: "library-${{ matrix.arch }}.tar.gz"

- name: Add library artifacts to release
if: |
Expand All @@ -172,7 +159,7 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
file: library-${{ matrix.arch }}.tar.gz
asset_name: 'library-${{ matrix.arch }}.tar.gz'
asset_name: "library-${{ matrix.arch }}.tar.gz"

build-golang:
name: Build and Test Go wrapper
Expand All @@ -183,10 +170,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: 'Use Golang 1.16.x+'
uses: actions/setup-go@v2
- name: "Use Golang 1.16.x+"
uses: actions/setup-go@v3
with:
go-version: '^1.16.0'
go-version: "^1.16.0"

- name: Fetch library artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -262,37 +249,35 @@ jobs:
run: npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version

build-ios:
name: Build Library (iOS)
runs-on: macos-latest

strategy:
matrix:
architecture:
[aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.architecture }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.architecture }} --package indy-vdr
- name: Save library
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.architecture}}
path: target/${{ matrix.architecture }}/release/libindy_vdr.a
name: Build Library (iOS)
runs-on: macos-latest

strategy:
matrix:
architecture:
[aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios]

steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.architecture }}
- run: cargo build --release --target ${{ matrix.architecture }} --package indy-vdr
- name: Save library
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.architecture}}
path: target/${{ matrix.architecture }}/release/libindy_vdr.a

create-ios-xcframework:
name: Create iOS xcframework
runs-on: macos-latest
needs: build-ios

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Fetch static libraries
uses: actions/download-artifact@v3
- run: >
Expand All @@ -309,7 +294,7 @@ jobs:
with:
name: indy_vdr.xcframework
path: output/
- uses: geekyeggo/delete-artifact@v1
- uses: geekyeggo/delete-artifact@v2
with:
name: |
aarch64-apple-ios
Expand All @@ -318,30 +303,28 @@ jobs:
failOnError: false

build-android:
name: Build library (Android)
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
[
aarch64-linux-android,
armv7-linux-androideabi,
i686-linux-android,
x86_64-linux-android,
]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{matrix.architecture}} --package indy-vdr
- name: Save library
uses: actions/upload-artifact@v2
with:
name: ${{matrix.architecture}}
path: target/${{ matrix.architecture }}/release/libindy_vdr.so
name: Build library (Android)
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
[
aarch64-linux-android,
armv7-linux-androideabi,
i686-linux-android,
x86_64-linux-android,
]

steps:
- uses: actions/checkout@v3
- run: |
cargo install --bins --git https://github.com/rust-embedded/cross --tag v0.2.4 cross
cross build --release --target ${{matrix.architecture}} --package indy-vdr
- name: Save library
uses: actions/upload-artifact@v3
with:
name: ${{matrix.architecture}}
path: target/${{ matrix.architecture }}/release/libindy_vdr.so

create-android-library:
name: Create library (Android)
Expand All @@ -357,11 +340,11 @@ jobs:
sudo mv i686-linux-android ./libs/x86
sudo mv x86_64-linux-android ./libs/x86_64
- name: Save Android library
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: android-libraries
path: ./libs
- uses: geekyeggo/delete-artifact@v1
- uses: geekyeggo/delete-artifact@v2
with:
name: |
aarch64-linux-android
Expand All @@ -371,40 +354,40 @@ jobs:
failOnError: false

create-ios-android-release-asset:
name: Create iOS and Android Release Assets
runs-on: ubuntu-latest
needs:
- create-ios-xcframework
- create-android-library
if: |
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish == 'true'))

steps:
- name: Fetch Android libraries
uses: actions/download-artifact@v3
with:
name: android-libraries
path: mobile/android/

- name: Fetch iOS Framework
uses: actions/download-artifact@v3
with:
name: indy_vdr.xcframework
path: mobile/ios/

- uses: a7ul/[email protected]
with:
command: c
files: ./mobile
outPath: "library-ios-android.tar.gz"

- name: Add library artifacts to release
uses: svenstaro/upload-release-action@v2
with:
file: library-ios-android.tar.gz
asset_name: "library-ios-android.tar.gz"
name: Create iOS and Android Release Assets
runs-on: ubuntu-latest
needs:
- create-ios-xcframework
- create-android-library
if: |
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish == 'true'))

steps:
- name: Fetch Android libraries
uses: actions/download-artifact@v3
with:
name: android-libraries
path: mobile/android/

- name: Fetch iOS Framework
uses: actions/download-artifact@v3
with:
name: indy_vdr.xcframework
path: mobile/ios/

- uses: a7ul/[email protected]
with:
command: c
files: ./mobile
outPath: "library-ios-android.tar.gz"

- name: Add library artifacts to release
uses: svenstaro/upload-release-action@v2
with:
file: library-ios-android.tar.gz
asset_name: "library-ios-android.tar.gz"

build-py:
name: Build and Test Python Wrapper
Expand Down