Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
953ce77
Merge pull request #6 from hyperledger/master
Toktar Sep 18, 2019
fac28ba
Merge branch 'master' of https://github.com/Toktar/indy-node
Toktar Jan 10, 2021
dbd33e5
Add test_auth_txn_with_deprecated_key
Toktar Jan 14, 2021
2e9029e
UP-37: add writing to test_auth_txn_with_deprecated_key
Toktar Jan 14, 2021
36886c2
UP-34: Start to add GET_FROZEN_LEDGERS and LEDGERS_FREEZE
Toktar Jan 19, 2021
6b75acc
UP-34: Add an auth rule for ledger freeze
Toktar Jan 20, 2021
d733ba1
UP-34: add ledgers freeze to auth_map
Toktar Jan 24, 2021
0cfe7e3
UP-34: get hash roots from audit for ledgers_freeze_handler
Toktar Jan 25, 2021
7fb6b8b
UP-34: move freeze ledgers transactions from indy-node to indy-plenum
Toktar Jan 26, 2021
b50d696
UP-34: change `dynamic_validation` in WriteRequestHandler
Toktar Jan 26, 2021
ade3dd4
UP-34: add frozen ledgers stubs to catchup and audit handler
Toktar Jan 28, 2021
6ed1b5a
initial commit
udosson Feb 2, 2021
1af9145
simplified workflow
udosson Feb 2, 2021
c491e78
removed decorator checks
udosson Feb 2, 2021
f14511d
removed slices
udosson Feb 2, 2021
f2a6d58
removed modules
udosson Feb 2, 2021
b2eb9cf
bug fix: removed strategy:
udosson Feb 2, 2021
6f90b08
adds GitHub Actions and build containers
m00sey Feb 4, 2021
30383ea
UP-34: update freeze tests and imports
Toktar Feb 9, 2021
e4033ef
update libraries v1
rytmarsh Feb 10, 2021
e9e59cc
Merge branch 'master' of https://github.com/hyperledger/indy-node int…
Toktar Feb 10, 2021
b06bf9c
UP-34: bump plenum version
Toktar Feb 10, 2021
5ea6e72
UP-34: fix `generate_auth_map`
Toktar Feb 10, 2021
f99cd0e
Merge pull request #1648 from Toktar/ga-ci
skhoroshavin Feb 10, 2021
08e9836
chore: Add workflow trigger
ryjones Feb 10, 2021
b411290
Add script for remove ledger
adenishchenko Feb 10, 2021
df7b41f
collections.abc and module for tests
rytmarsh Feb 10, 2021
a4722ab
Merge remote-tracking branch 'ryan/ubuntu-20.04-upgrade' into ubuntu-…
rytmarsh Feb 10, 2021
a520884
Merge remote-tracking branch 'ryan/ubuntu-20.04-upgrade' into ubuntu-…
rytmarsh Feb 10, 2021
ac5a12b
Fix after review
adenishchenko Feb 11, 2021
f8a94fc
Fix linter issues
adenishchenko Feb 11, 2021
ab9225b
UP-34: fix frozen ledgers auth tests
Toktar Feb 11, 2021
a680bbf
UP-34: fix test_transactions.py import
Toktar Feb 11, 2021
939b4a4
UP-34: fix ledgers_freeze_handler bug with validation
Toktar Feb 11, 2021
58bd670
UP-34: fix edit_frozen_ledgers test
Toktar Feb 11, 2021
d166dac
UP-34: fix edit_frozen_ledgers test
Toktar Feb 11, 2021
b3f5803
fixes pool_restart tests
rytmarsh Feb 11, 2021
f2253f1
fixes pool_restart tests
rytmarsh Feb 11, 2021
90c1da8
UP-34: fix edit_frozen_ledgers test
Toktar Feb 11, 2021
f39e82e
Add warn before delete ledger
adenishchenko Feb 12, 2021
09d78df
Merge pull request #1649 from hyperledger/UGF
ryjones Feb 12, 2021
4d1ab46
Merge pull request #1641 from Toktar/up-34-add-ledger-freeze
Toktar Feb 12, 2021
dfe641b
Refactoring after review
adenishchenko Feb 12, 2021
f8ccba1
Minor fix
adenishchenko Feb 12, 2021
8d0b8cc
upgrades deps and pytest features
rytmarsh Feb 12, 2021
75c12d9
upgrades deps and pytest features
rytmarsh Feb 12, 2021
263c38c
Remove extra white spaces
adenishchenko Feb 14, 2021
c09221c
Bump plenum and fix bump libindy
adenishchenko Feb 16, 2021
7ec31dc
Merge pull request #1650 from adenishchenko/migration_mainnet
Toktar Feb 16, 2021
9575e5b
Merge remote-tracking branch 'upstream/master' into bump_libindy_1618
adenishchenko Feb 16, 2021
10fb439
another broken test
rytmarsh Feb 16, 2021
2b600ee
another broken test
rytmarsh Feb 16, 2021
9959164
:
rytmarsh Feb 16, 2021
8a5ed3e
:
rytmarsh Feb 16, 2021
30ffcb0
adds failing tests to upgrade
rytmarsh Feb 16, 2021
4bb8043
adds failing tests to upgrade
rytmarsh Feb 16, 2021
294af1d
.
rytmarsh Feb 17, 2021
93c89e9
.
rytmarsh Feb 17, 2021
2ade6ea
Bump libindy version for python wrapper
adenishchenko Feb 18, 2021
dc0d8bb
Fix pip version for ci
adenishchenko Feb 18, 2021
749ea14
changes get_marker() to get_closest_marker()
rytmarsh Feb 18, 2021
45d2b74
changes get_marker() to get_closest_marker()
rytmarsh Feb 18, 2021
4db3cc0
fixes multiple broken tests around newer pytest version
rytmarsh Feb 18, 2021
8462ec8
fixes multiple broken tests around newer pytest version
rytmarsh Feb 18, 2021
f809114
Pin pip version for CD
adenishchenko Feb 19, 2021
bc995f5
Fix pin pip for cd
adenishchenko Feb 19, 2021
56bb94e
updates setup.py with newer python package versions
rytmarsh Feb 19, 2021
58c67a6
updates setup.py with newer python package versions
rytmarsh Feb 19, 2021
1a65214
fixes broken fixture
rytmarsh Feb 23, 2021
33a9a21
fixes broken fixture
rytmarsh Feb 23, 2021
ec78113
Set xenial version for CD pipeline
adenishchenko Feb 24, 2021
5908cba
updates failing test list
rytmarsh Feb 24, 2021
3087d29
updates failing test list
rytmarsh Feb 24, 2021
b66ade3
fixes failing tests by looking 4 minutes in the past with journalctl
rytmarsh Feb 25, 2021
cb3e790
fixes failing tests by looking 4 minutes in the past with journalctl
rytmarsh Feb 25, 2021
460e509
Delete useless test
adenishchenko Mar 5, 2021
1cd98b5
Delete useless test
adenishchenko Mar 5, 2021
7d42070
Merge remote-tracking branch 'origin/ubuntu-20.04' into github-actions
adenishchenko Mar 31, 2021
1039456
Update build-u18004.yml
adenishchenko Mar 31, 2021
fe49028
Add files via upload
adenishchenko Mar 31, 2021
8656445
Update build-u18004.yml
adenishchenko Mar 31, 2021
48cfd82
Update build-u18004.yml
adenishchenko Mar 31, 2021
446e2d8
Update build-u18004.yml
adenishchenko Mar 31, 2021
1579a91
Update build-u18004.yml
adenishchenko Mar 31, 2021
e26134a
Update build-u18004.yml
adenishchenko Mar 31, 2021
b86bfd8
Update build-u18004.yml
adenishchenko Mar 31, 2021
50c66fd
Update build-u18004.yml
adenishchenko Mar 31, 2021
1037307
Update build-u18004.yml
adenishchenko Mar 31, 2021
a36482c
Update build-u18004.yml
adenishchenko Mar 31, 2021
a570fb7
Update build-u18004.yml
adenishchenko Apr 1, 2021
92c051a
Update build-u18004.yml
adenishchenko Apr 1, 2021
8ed1e5c
Update build-u18004.yml
adenishchenko Apr 1, 2021
3948771
Update build-u18004.yml
adenishchenko Apr 1, 2021
04b3bae
Update build-u18004.yml
adenishchenko Apr 1, 2021
b0d0a29
Update build-u18004.yml
adenishchenko Apr 1, 2021
572b2cb
Update build-u18004.yml
adenishchenko Apr 1, 2021
289a46d
Update build-u18004.yml
adenishchenko Apr 1, 2021
0e71892
Update build-u18004.yml
adenishchenko Apr 1, 2021
091ec5c
Update build-u18004.yml
adenishchenko Apr 1, 2021
4a2fa47
Update build-u18004.yml
adenishchenko Apr 1, 2021
06cf1b5
Update build-u18004.yml
adenishchenko Apr 1, 2021
f5d9fed
Update build-u18004.yml
adenishchenko Apr 2, 2021
41d4c29
Update build-u18004.yml
adenishchenko Apr 2, 2021
bd21d3a
Add Dockerfiles
adenishchenko Apr 2, 2021
60d4fd6
Update build-u18004.yml
adenishchenko Apr 2, 2021
7ea4883
Update build-u18004.yml
adenishchenko Apr 2, 2021
091aeed
Update build-u18004.yml
adenishchenko Apr 2, 2021
8856629
Change Dockerfiles
adenishchenko Apr 2, 2021
9955c4e
Update build-u18004.yml
adenishchenko Apr 2, 2021
ebcbb48
Update build-u18004.yml
adenishchenko Apr 2, 2021
9109ed4
Update build-u18004.yml
adenishchenko Apr 2, 2021
0560c96
Merge remote-tracking branch 'origin/ubuntu-20.04' into gha-test
adenishchenko Apr 2, 2021
cc8e7f6
Merge remote-tracking branch 'origin/bump_libindy_1618' into gha-test
adenishchenko Apr 3, 2021
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
25 changes: 25 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Github Actions Workflow

This build file replaces the existing `Jenkins.ci` build process.

`lint.yaml` replaces the `Static code validation` stage of the Jenkins build.

`build.yaml` replaces the `Build / Test` stage of the Jenkins build.

Many of the other stages are replaced merely by the fact we're using Github Actions, we use prebuild Docker containers so we don't have to replicate the steps for building containers.

The `Build result notification` stage was not moved to GHA, build failures will be reports via GHA.

The build process for `Jenkins.nightly` was not ported to GHA.

#### Configuring actions

If you are cloning or forking this repo you will need to configure two secrets for Actions to run correctly.

Secrets can be set via Settings -> Secrets -> New repository secret.

CR_USER is your GH username.
CR_PAT can be created by following [these directions](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)

Once you have run the build once with those secrets, you have to make then package public.
Access the package at https://ghcr.io/USER/indy-node/indy-node-build or https://ghcr.io/USER/indy-node/indy-node-lint then change the visibility in 'Package Settings' to 'Public' then re-run the build.
254 changes: 254 additions & 0 deletions .github/workflows/build-u18004.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
name: indy-node-build
on: [ push, pull_request, workflow_dispatch ]

jobs:
workflow-setup:
runs-on: ubuntu-latest
outputs:
CACHE_KEY_LINT: ${{ steps.cache.outputs.CACHE_KEY_LINT }}
CACHE_KEY_BUILD: ${{ steps.cache.outputs.CACHE_KEY_BUILD }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.cache.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set outputs
id: cache
run: |
echo "::set-output name=CACHE_KEY_LINT::${{ hashFiles('.github/workflows/lint/Dockerfile') }}"
echo "::set-output name=CACHE_KEY_BUILD::${{ hashFiles('.github/workflows/build/Dockerfile') }}"
echo "::set-output name=GITHUB_REPOSITORY_NAME::$(echo ${GITHUB_REPOSITORY,,})"

build-lint-image:
needs: workflow-setup
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
CACHE_KEY_LINT: ${{ needs.workflow-setup.outputs.CACHE_KEY_LINT }}
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Try load from cache.
id: cache-image-lint
uses: actions/cache@v2
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ env.CACHE_KEY_LINT }}
- name: If NOT found in cache, build and push image.
if: steps.cache-image-lint.outputs.cache-hit != 'true'
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
docker build -f .github/workflows/lint/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:${{ env.CACHE_KEY_LINT }} .
docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:${{ env.CACHE_KEY_LINT }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:latest
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:latest
mkdir -p ${GITHUB_WORKSPACE}/cache
touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_LINT }}
build-test-image:
needs: workflow-setup
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
CACHE_KEY_BUILD: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD }}
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Try load from cache.
id: cache-image-build
uses: actions/cache@v2
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ env.CACHE_KEY_BUILD }}
- name: If NOT found in cache, build and push image.
if: steps.cache-image-build.outputs.cache-hit != 'true'
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
docker build -f .github/workflows/build/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:${{ env.CACHE_KEY_BUILD }} .
docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:${{ env.CACHE_KEY_BUILD }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:latest
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:latest
mkdir -p ${GITHUB_WORKSPACE}/cache
touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_BUILD }}
indy_node:
name: Build Indy Node
needs: build-test-image
runs-on: ubuntu-20.04
container:
image: ghcr.io/${{ github.repository }}/indy-node-build
strategy:
matrix:
module: [indy_node, indy_common]
slice: [1, 2, 3, 4 ,5, 6, 7,8, 9, 10, 11]
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install dependencies
run: pip install .[tests]
continue-on-error: true

- name: Run Indy Node ${{ matrix.module }} test slice ${{ matrix.slice }}/${{ strategy.job-total }}
run: RUSTPYTHONASYNCIODEBUG=0 python3 runner.py --pytest "python3 -m pytest -l -vv --junitxml=test-result-indy-node-${{ matrix.module }}-${{ matrix.slice }}.xml" --dir "${{ matrix.module }}" --output "test-result-indy-node-${{ matrix.slice }}.txt" --test-only-slice "${{ matrix.slice }}/${{ strategy.job-total }}"

- name: Publish Test Report
uses: scacap/action-surefire-report@v1
continue-on-error: true
with:
check_name: Indy Node ${{ matrix.module }} ${{ matrix.slice }}/${{ strategy.job-total }} Test Report
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: test-result-indy-node-${{ matrix.module }}-${{ matrix.slice }}.xml

lint:
name: Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/adenishchenko/indy-node/indy-node-lint
needs: [workflow-setup, build-lint-image]
steps:
- name: Check out code
uses: actions/checkout@v2

- name: flake8
run: python3 -m flake8

# name: indy-node-build-u2004
# on: [ push, pull_request ]

# jobs:
# workflow-setup:
# runs-on: ubuntu-20.04
# outputs:
# CACHE_KEY_CI_IMAGE: ${{ steps.cache.outputs.CACHE_KEY_CI_IMAGE }}
# CACHE_KEY_BUILD_IMAGE: ${{ steps.cache.outputs.CACHE_KEY_BUILD_IMAGE }}
# GITHUB_REPOSITORY_NAME: ${{ steps.cache.outputs.GITHUB_REPOSITORY_NAME }}
# DOCKER_FILE_POSTFIX: ${{ steps.cache.outputs.DOCKER_FILE_POSTFIX }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2

# - name: Set outputs
# id: cache
# run: |
# echo "::set-output name=CACHE_KEY_CI_IMAGE::${{ hashFiles('.github/workflows/test/Dockerfile') }}-rc1"
# echo "::set-output name=CACHE_KEY_BUILD_IMAGE::${{ hashFiles('.github/workflows/build/Dockerfile') }}-rc1"
# # Convert the GitHub repository name to lowercase
# echo "::set-output name=GITHUB_REPOSITORY_NAME::$(echo ${GITHUB_REPOSITORY,,})"
# echo "::set-output name=DOCKER_FILE_POSTFIX::ubuntu-20-04"


# test-image:
# # Reference to workflow-setup job is required to access its various outputs.
# needs: workflow-setup
# runs-on: ubuntu-latest
# env:
# DOCKER_BUILDKIT: 1
# CACHE_KEY_CI_IMAGE: ${{ needs.workflow-setup.outputs.CACHE_KEY_CI_IMAGE }}
# GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
# DOCKER_FILE_POSTFIX: ${{ needs.workflow-setup.outputs.DOCKER_FILE_POSTFIX }}
# steps:
# - name: Git checkout
# uses: actions/checkout@v2

# - name: Try load from cache.
# id: cache-image
# uses: actions/cache@v2
# with:
# path: ${GITHUB_WORKSPACE}/cache
# key: ${{ env.CACHE_KEY_CI_IMAGE}}

# - name: If NOT found in cache, build and push image.
# if: steps.cache-image.outputs.cache-hit != 'true'
# run: |
# echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
# docker build -f .github/workflows/test/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/node-test:${{ env.CACHE_KEY_CI_IMAGE }} .
# docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/node-test:${{ env.CACHE_KEY_CI_IMAGE }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/node-test:${{ env.DOCKER_FILE_POSTFIX }}
# docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/node-test:${{ env.DOCKER_FILE_POSTFIX }}
# mkdir -p ${GITHUB_WORKSPACE}/cache
# touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_CI_IMAGE }}

# build-image:
# # Reference to workflow-setup job is required to access its various outputs.
# needs: workflow-setup
# runs-on: ubuntu-latest
# env:
# DOCKER_BUILDKIT: 1
# CACHE_KEY_BUILD_IMAGE: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD_IMAGE }}
# GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
# DOCKER_FILE_POSTFIX: ${{ needs.workflow-setup.outputs.DOCKER_FILE_POSTFIX }}
# steps:
# - name: Git checkout
# uses: actions/checkout@v2

# - name: Try load from cache.
# id: cache-image
# uses: actions/cache@v2
# with:
# path: ${GITHUB_WORKSPACE}/cache
# key: ${{ env.CACHE_KEY_BUILD_IMAGE }}

# - name: If NOT found in cache, build and push image.
# if: steps.cache-image.outputs.cache-hit != 'true'
# run: |
# echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
# docker build -f .github/workflows/build/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/node-build:${{ env.CACHE_KEY_BUILD_IMAGE }} .
# docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/node-build:${{ env.CACHE_KEY_BUILD_IMAGE }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/node-build:${{ env.DOCKER_FILE_POSTFIX }}
# docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/node-build:${{ env.DOCKER_FILE_POSTFIX }}
# mkdir -p ${GITHUB_WORKSPACE}/cache
# touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_BUILD_IMAGE }}








# indy-common:
# name: Build Indy Common
# runs-on: ubuntu-latest
# #TODO: move this to hyperledger?
# container: udosson/indy-node-ci-u1804:latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2

# - name: Install dependencies
# run: pip install .[tests]
# continue-on-error: true

# - name: Run Indy Common test
# run: python3 -m pytest -l -vv --junitxml=test-result-indy-common.xml --dir indy_common --output "test-result-indy-common.txt"

# indy-node:
# name: Build Indy Node
# runs-on: ubuntu-18.04
# #TODO: move this to hyperledger?
# container: udosson/indy-node-ci-u1804:latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2

# - name: Install dependencies
# run: pip install .[tests]
# continue-on-error: true

# - name: Run Indy Node test
# run: python3 -m pytest -l -vv --junitxml=test-result-indy-node.xml --dir indy_node --output "test-result-indy-node.txt"



# lint:
# name: Lint
# runs-on: ubuntu-18.04
# #TODO: move this to hyperledger?
# container: udosson/indy-node-ci-u1804:latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2

# - name: flake8
# run: python3 -m flake8
117 changes: 117 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: indy-node-build
on: [ push, pull_request, workflow_dispatch ]

jobs:
workflow-setup:
runs-on: ubuntu-latest
outputs:
CACHE_KEY_LINT: ${{ steps.cache.outputs.CACHE_KEY_LINT }}
CACHE_KEY_BUILD: ${{ steps.cache.outputs.CACHE_KEY_BUILD }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.cache.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set outputs
id: cache
run: |
echo "::set-output name=CACHE_KEY_LINT::${{ hashFiles('.github/workflows/lint/Dockerfile') }}"
echo "::set-output name=CACHE_KEY_BUILD::${{ hashFiles('.github/workflows/build/Dockerfile') }}"
echo "::set-output name=GITHUB_REPOSITORY_NAME::$(echo ${GITHUB_REPOSITORY,,})"

build-lint-image:
needs: workflow-setup
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
CACHE_KEY_LINT: ${{ needs.workflow-setup.outputs.CACHE_KEY_LINT }}
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Try load from cache.
id: cache-image-lint
uses: actions/cache@v2
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ env.CACHE_KEY_LINT }}
- name: If NOT found in cache, build and push image.
if: steps.cache-image-lint.outputs.cache-hit != 'true'
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
docker build -f .github/workflows/lint/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:${{ env.CACHE_KEY_LINT }} .
docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:${{ env.CACHE_KEY_LINT }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:latest
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-lint:latest
mkdir -p ${GITHUB_WORKSPACE}/cache
touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_LINT }}

build-test-image:
needs: workflow-setup
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
CACHE_KEY_BUILD: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD }}
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Try load from cache.
id: cache-image-build
uses: actions/cache@v2
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ env.CACHE_KEY_BUILD }}
- name: If NOT found in cache, build and push image.
if: steps.cache-image-build.outputs.cache-hit != 'true'
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io --username ${{ secrets.CR_USER }} --password-stdin
docker build -f .github/workflows/build/Dockerfile --no-cache -t ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:${{ env.CACHE_KEY_BUILD }} .
docker tag ${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:${{ env.CACHE_KEY_BUILD }} ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:latest
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}/indy-node-build:latest
mkdir -p ${GITHUB_WORKSPACE}/cache
touch ${GITHUB_WORKSPACE}/cache/${{ env.CACHE_KEY_BUILD }}

indy_node:
name: Build Indy Node
needs: build-test-image
runs-on: ubuntu-18.04
container:
image: ghcr.io/${{ github.repository }}/indy-node-build
strategy:
matrix:
module: [indy_node, indy_common]
slice: [1, 2, 3, 4 ,5, 6, 7,8, 9, 10, 11]
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install dependencies
run: pip install .[tests]
continue-on-error: true

- name: Run Indy Node ${{ matrix.module }} test slice ${{ matrix.slice }}/${{ strategy.job-total }}
run: RUSTPYTHONASYNCIODEBUG=0 python3 runner.py --pytest "python3 -m pytest -l -vv --junitxml=test-result-indy-node-${{ matrix.module }}-${{ matrix.slice }}.xml" --dir "${{ matrix.module }}" --output "test-result-indy-node-${{ matrix.slice }}.txt" --test-only-slice "${{ matrix.slice }}/${{ strategy.job-total }}"

- name: Publish Test Report
uses: scacap/action-surefire-report@v1
with:
check_name: Indy Node ${{ matrix.module }} ${{ matrix.slice }}/${{ strategy.job-total }} Test Report
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: test-result-indy-node-${{ matrix.module }}-${{ matrix.slice }}.xml

lint:
name: Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/indy-node-lint
needs: [workflow-setup, build-lint-image]
steps:
- name: Check out code
uses: actions/checkout@v2

- name: flake8
run: python3 -m flake8
Loading