diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 94f981b..e5f8418 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -75,19 +75,23 @@ jobs: - name: Azure Login uses: azure/login@v2 + if: matrix.is_deployable == true with: creds: ${{ secrets.AZURE_CREDENTIALS_E2E_TESTS }} - name: Deploy to Azure Functions uses: Azure/functions-action@v1 + if: matrix.is_deployable == true with: app-name: nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }} package: examples/with-${{ matrix.runtime }}/.nmt/dist - name: Wait for the deployment to finish + if: matrix.is_deployable == true run: sleep 15 - name: Run E2E tests + if: matrix.is_deployable == true run: pnpm exec nx run @infra/azure-functions:test env: AZURE_FUNCTIONS_URL: https://nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}.azurewebsites.net diff --git a/infra/azure-functions/src/config.ts b/infra/azure-functions/src/config.ts index 9ac0b3c..58afd70 100644 --- a/infra/azure-functions/src/config.ts +++ b/infra/azure-functions/src/config.ts @@ -6,18 +6,25 @@ export const infraConfigs = createInfraConfig( 'node18-win-x64': process.env.RESOURCE_IDENTIFIER_NODE18_WIN_X64, }, [ + // --- Node 18 --- { platform: 'linux', arch: 'x64', runtime: 'node18', isDeployable: true, }, - // { - // platform: 'win', - // arch: 'x64', - // runtime: 'node18', - // isDeployable: true, - // }, + { + platform: 'win', + arch: 'x64', + runtime: 'node18', + // isDeployable: true, + }, + { + platform: 'macos', + arch: 'arm64', + runtime: 'node18', + }, + // --- Bun ---- // { // platform: 'linux', // arch: 'x64', diff --git a/infra/azure-functions/src/github-actions.ts b/infra/azure-functions/src/github-actions.ts index 0269276..2ff6a57 100644 --- a/infra/azure-functions/src/github-actions.ts +++ b/infra/azure-functions/src/github-actions.ts @@ -23,6 +23,10 @@ export interface GithubActionsMatrix { * Resource Identifier Key for getting value from github actions secrets */ resource_identifier_key: string; + /** + * is deployable + */ + is_deployable?: boolean; } /** @@ -51,6 +55,7 @@ export function toGithubActionsMatrix(configs: InfraEnvConfig[]): GithubActionsM runtime: runtime === 'bun' ? 'bun' : 'node', version, target: toTarget(config), + is_deployable: config.isDeployable, resource_identifier_key: `RESOURCE_IDENTIFIER_${toTarget(config).replaceAll('-', '_').toUpperCase()}`, } satisfies GithubActionsMatrix; }); diff --git a/infra/azure-functions/src/utils.ts b/infra/azure-functions/src/utils.ts index 9fbc016..feec51e 100644 --- a/infra/azure-functions/src/utils.ts +++ b/infra/azure-functions/src/utils.ts @@ -17,13 +17,13 @@ export function createInfraConfig( infraConfigs: InfraEnvConfig[] ): InfraEnvConfig[] { return infraConfigs - .filter(config => config.isDeployable) .map(infraConfig => { const resourceIdentifier: string = resourceIdentifiers[toTarget(infraConfig)] ?? fallbackResourceIdentifier(infraConfig); return { ...infraConfig, + isDeployable: infraConfig.isDeployable ?? false, resourceIdentifier, }; });