-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This centralising the caching for the provider builds, along with making the workflow a shared one.
- Loading branch information
Showing
12 changed files
with
139 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build / Cache Providers | ||
|
||
on: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: provider-builds | ||
|
||
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/random/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 | ||
echo "$(pwd)/node_modules/.bin/" >> $GITHUB_PATH | ||
cally provider build --provider ${{ matrix.provider }} --version ${{ matrix.version }} | ||
(cd build/${{ matrix.provider }} && python -m build) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from cally.cli.config import CallyConfig | ||
|
||
from ... import CallyIdpTestHarness | ||
|
||
|
||
class CallyIdpConfigTests(CallyIdpTestHarness): | ||
|
||
def test_idp_defaults(self): | ||
config = CallyConfig(config_file='blah.yaml') | ||
config.environment = 'harness' | ||
config.service = 'idp-defaults-ya' | ||
data = { | ||
'ENVIRONMENT': 'harness', | ||
'NAME': 'idp-defaults-ya', | ||
'PROVIDERS': {'provido': {'location': 'some-place1'}}, | ||
} | ||
self.assertDictEqual(config.settings.to_dict(), data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DEFAULTS = {'providers': {'provido': {'location': 'some-place1'}}} |