Repository navigation
97 lines (91 loc) · 3.14 KB
/
Copy pathtest.yml
File metadata and controls
97 lines (91 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: Test
on:
workflow_call:
inputs:
ref:
description: Branch, tag or SHA to test.
type: string
required: false
default: ""
permissions:
contents: read
jobs:
test:
name: Unit test
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt -r requirements-dev.txt
python -m pip install -e .
- name: Run tests
run: python -m pytest -q
# TODO: If you have integration tests against a real Fabric peer,
# uncomment this job and adjust the paths. It is the equivalent of the
# `integrationtest` job in the Java workflow.
# integrationtest:
# name: Integration test
# runs-on: ubuntu-latest
# timeout-minutes: 45
# steps:
# - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# with:
# ref: ${{ inputs.ref }}
# fetch-depth: 0
# - name: Set up Python
# uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
# with:
# python-version: '3.11'
# cache: 'pip'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install -r requirements.txt -r requirements-dev.txt
# - name: Ensure that the Peer/weft tools are available
# run: |
# curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
# npm install -g @hyperledger-labs/weft
# echo "FABRIC_CFG_PATH=$GITHUB_WORKSPACE/config" >> $GITHUB_ENV
# echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
# - name: versions
# run: |
# peer version
# weft --version
# - name: Integration Tests
# run: python -m pytest -q integration_test/
# TODO: If you publish a base Docker image for Python chaincode,
# uncomment this job. It is the equivalent of the Java `docker` job.
# docker:
# name: Build Docker image
# runs-on: ubuntu-latest
# timeout-minutes: 30
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# with:
# ref: ${{ inputs.ref }}
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@c7c853bb5d3c0d0de6c775bda84e8f9be9bed9339 # v3.10.0
# - name: Build image
# uses: docker/build-push-action@v6
# with:
# context: .
# file: ./Dockerfile
# push: false
# tags: fabric-pythonenv:latest