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

Use Centralised Build Workflow #12

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .github/workflows/build-providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Build / Cache Providers

on:
workflow_call:
push:
branches:
- main

concurrency:
group: provider-builds
Expand All @@ -23,7 +26,7 @@ jobs:
id: cache-providers
uses: actions/cache@v4
with:
path: build/random/dist/${ matrix.name }}-${{ matrix.version }}.tar.gz
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'
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/coverage-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,27 @@ on:
- main

jobs:
build-providers:
uses: ./.github/workflows/build-providers.yaml
coverage-build:
runs-on: ubuntu-latest
needs: build-providers
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v3
id: cache
with:
path: build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
key: cally-provider-random-3.6.0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install Cally test dependencies
run: pip install .[test]
- name: Restore Provider Packages
id: cache-providers
uses: actions/cache@v4
with:
path: build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
key: cally-provider-random-3.6.0
- 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
echo "$(pwd)/node_modules/.bin/" >> $GITHUB_PATH
cally provider build --provider random --version 3.6.0
(cd build/random && python -m build)
- name: Install Provider Pacakge
run: pip install build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
- name: Install Cally test dependencies
run: pip install .[test]
- name: Run Coverage
run: |
coverage run -m pytest
Expand Down
34 changes: 12 additions & 22 deletions .github/workflows/test-cally.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,33 @@ on:
- main

jobs:
build-providers:
uses: ./.github/workflows/build-providers.yaml
pytest:
runs-on: ubuntu-latest
needs: build-providers
strategy:
matrix:
python: ["3.11"]
steps:
# Restore Provider Packages
- uses: actions/checkout@v4
- uses: actions/cache/restore@v3
id: cache
with:
path: build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
key: cally-provider-random-3.6.0

# Cally Testing
# Cally Install
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install Cally test dependencies
run: pip install .[test]

# Provider Packages
- name: Restore Provider Packages
id: cache-providers
uses: actions/cache@v4
with:
path: build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
key: cally-provider-random-3.6.0
- 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
echo "$(pwd)/node_modules/.bin/" >> $GITHUB_PATH
cally provider build --provider random --version 3.6.0
(cd build/random && python -m build)
- name: Install Provider Pacakge
run: pip install build/random/dist/CallyProvidersRandom-3.6.0.tar.gz
- name: Install Cally test dependencies
run: pip install .[test]

# Run Tests
- name: Run Pytest
Expand Down
Loading