Skip to content

Commit

Permalink
Merge branch 'fix/update-metadata-action'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbluhm committed Dec 20, 2022
2 parents 888cd43 + 47e97bc commit 8bb2cfa
Show file tree
Hide file tree
Showing 17 changed files with 835 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ build
docs
dist
test-reports
.python-version
.python-version
docker
env
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/integrationtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
with:
path: acapy
#- name: run-von-network
# uses: ./acapy/actions/run-von-network
# uses: ./acapy/.github/actions/run-von-network
#- name: run-indy-tails-server
# uses: ./acapy/actions/run-indy-tails-server
# uses: ./acapy/.github/actions/run-indy-tails-server
- name: run-integration-tests
uses: ./acapy/actions/run-integration-tests
uses: ./acapy/.github/actions/run-integration-tests
# to run with a specific set of tests include the following parameter:
# with:
# TEST_SCOPE: "-t @T001-RFC0037"
39 changes: 39 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Nightly Tests

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
tests:
name: Tests
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: "ubuntu-20.04"
python-version: "3.6"
uses: ./.github/workflows/tests.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}

tests-indy:
name: Tests (Indy)
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: "ubuntu-20.04"
python-version: "3.6"

uses: ./.github/workflows/tests-indy.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
indy-version: "1.16.0"
20 changes: 20 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Tests

on:
pull_request:

jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml
with:
python-version: "3.6"
os: "ubuntu-20.04"

tests-indy:
name: Tests (Indy)
uses: ./.github/workflows/tests-indy.yml
with:
python-version: "3.6"
indy-version: "1.16.0"
os: "ubuntu-20.04"
99 changes: 99 additions & 0 deletions .github/workflows/publish-indy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Publish ACA-Py (Indy)
on:
release:
types: [released]
workflow_dispatch:
inputs:
indy_version:
description: 'Indy SDK Version'
required: false
type: string
tag:
description: 'Image tag'
required: true
type: string
version:
description: "Version label in image"
required: true
type: string

env:
INDY_VERSION: 1.16.0

jobs:
publish-image:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

name: Publish (Indy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Gather image info
id: info
run: |
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}"
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Image Metadata (manual)
if: github.event_name == 'workflow_dispatch'
id: dispatch-meta
uses: docker/[email protected]
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=raw,value=py${{ matrix.python-version }}-indy-${{ inputs.tag }}
- name: Setup Image Metadata (release)
if: github.event_name == 'release'
id: meta
uses: docker/[email protected]
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=semver,pattern=py${{ matrix.python-version }}-indy-{{ inputs.indy_version || env.INDY_VERSION }}-{{version}}
- name: Build and Push Image to ghcr.io
uses: docker/build-push-action@v3
with:
push: true
context: .
file: docker/Dockerfile.indy
tags: ${{ steps.dispatch-meta.outputs.tags || steps.meta.outputs.tags }}
target: main
build-args: |
python_version=${{ matrix.python-version }}
indy_version=${{ inputs.indy_version || env.INDY_VERSION }}
acapy_version=${{ inputs.version || github.event.release.tag_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
91 changes: 91 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish ACA-Py
on:
release:
types: [released]
workflow_dispatch:
inputs:
tag:
description: 'Image tag'
required: true
type: string
version:
description: "Version label in image"
required: true
type: string

jobs:
publish-image:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Gather image info
id: info
run: |
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}"
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Image Metadata (manual)
if: github.event_name == 'workflow_dispatch'
id: dispatch-meta
uses: docker/[email protected]
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag }}
- name: Setup Image Metadata (release)
if: github.event_name == 'release'
id: meta
uses: docker/[email protected]
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=semver,pattern=py${{ matrix.python-version }}-{{version}}
- name: Build and Push Image to ghcr.io
uses: docker/build-push-action@v3
with:
push: true
context: .
file: docker/Dockerfile
tags: ${{ steps.dispatch-meta.outputs.tags || steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
python_version=${{ matrix.python-version }}
acapy_version=${{ inputs.version || github.event.release.tag_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
58 changes: 58 additions & 0 deletions .github/workflows/tests-indy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Tests (Indy)

on:
workflow_call:
inputs:
python-version:
required: true
type: string
indy-version:
required: true
type: string
os:
required: true
type: string

jobs:
tests:
name: Test Python ${{ inputs.python-version }} on Indy ${{ inputs.indy-version }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3

- name: Cache image layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-test
key: ${{ runner.os }}-buildx-test-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-test-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build test image
uses: docker/build-push-action@v3
with:
load: true
context: .
file: docker/Dockerfile.indy
target: acapy-test
tags: acapy-test:latest
build-args: |
python_version=${{ inputs.python-version }}
indy_version=${{ inputs.indy-version }}
cache-from: type=local,src=/tmp/.buildx-cache-test
cache-to: type=local,dest=/tmp/.buildx-cache-test-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache-test
mv /tmp/.buildx-cache-test-new /tmp/.buildx-cache-test
- name: Run pytest
run: |
docker run --rm acapy-test:latest
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
workflow_call:
inputs:
python-version:
required: true
type: string
os:
required: true
type: string

jobs:
tests:
name: Test Python ${{ inputs.python-version }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements*.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
- name: Tests
run: |
pytest --junitxml=pytest.xml
- name: Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: pytest.xml
Loading

0 comments on commit 8bb2cfa

Please sign in to comment.