Skip to content

Merge pull request #15 from CallyCo-io/docs/readme #4

Merge pull request #15 from CallyCo-io/docs/readme

Merge pull request #15 from CallyCo-io/docs/readme #4

name: Build / Cache Providers
on:
workflow_call:
push:
branches:
- main
jobs:
build-providers:
strategy:
matrix:
include:
- provider: random
version: 3.6.0
name: CallyProvidersRandom
- provider: google
version: 5.21.0
name: CallyProvidersGoogle
runs-on: ubuntu-latest
steps:
- name: Restore Provider Packages
id: cache-providers
uses: actions/cache@v4
with:
path: build/${{ matrix.provider }}/dist/${{ matrix.name }}-${{ matrix.version }}.tar.gz
key: cally-provider-${{ matrix.provider }}-${{ matrix.version }}
- uses: actions/checkout@v4
if: steps.cache-providers.outputs.cache-hit != 'true'
- name: Setup Python
if: steps.cache-providers.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install Cally
if: steps.cache-providers.outputs.cache-hit != 'true'
run: pip install .[provider_build]
- uses: actions/setup-node@v4
if: steps.cache-providers.outputs.cache-hit != 'true'
with:
node-version: "20"
- name: Install cdktf-cli and build
if: steps.cache-providers.outputs.cache-hit != 'true'
run: |
npm install cdktf-cli
export PATH=:$(pwd)/node_modules/.bin:$PATH
cally provider build --provider ${{ matrix.provider }} --version ${{ matrix.version }}
(cd build/${{ matrix.provider }} && python -m build)
- name: Install + check package
if: steps.cache-providers.outputs.cache-hit != 'true'
run: |
pip install build/${{ matrix.provider }}/dist/${{ matrix.name }}-${{ matrix.version }}.tar.gz
python -c 'import pkgutil,sys; sys.exit(0) if pkgutil.find_loader("cally.providers.${{ matrix.provider }}") else sys.exit(1)'