Skip to content

Commit

Permalink
fix(github-actions): download artifact path
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 17, 2024
1 parent 7664717 commit 569d4e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,13 @@ jobs:
- build
- get-matrix
timeout-minutes: 10
env:
artifact_download_path: ./build-functions
strategy:
matrix:
include: ${{fromJson(needs.get-matrix.outputs.matrix)}}

steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.resource_identifier_key }}
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

Expand All @@ -120,11 +118,20 @@ jobs:
- name: Azure Functions Version
run: func --version

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.resource_identifier_key }}
path: ${{ github.workspace }}/${{ env.artifact_download_path}}

- name: Display structure of downloaded files
run: ls -R ${{ github.workspace }}/${{ env.artifact_download_path}}

- name: Build the project
run: pnpm exec nx run @infra/e2e-local:test
env:
RUNTIME: ${{ matrix.runtime }}
CURRENT_WORKING_DIR: ${{ github.workspace }}/${{ env.artifact_download_path}}

deploy:
runs-on: ubuntu-latest
needs:
Expand Down
6 changes: 3 additions & 3 deletions infra/e2e-local/e2e-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const TIME_LIMIT = parseInt(process.env.TIME_LIMIT ?? '60000'); // Default 60 se
const DEBUG = (process.env.LOCAL_TEST_DEBUG ?? '').toLowerCase() === 'true';
const LOCAL_URL = process.env.LOCAL_TEST_URL ?? 'http://127.0.0.1:7071';
const HEALTH_PATH = process.env.LOCAL_TEST_HEALTH_PATH ?? '/api/SimpleHttpTrigger';
const CURRENT_WORKING_DIR = process.env.CURRENT_WORKING_DIR ?? path.resolve('../../');

function waitForServer(url: string) {
return new Promise<void>((resolve, reject) => {
Expand Down Expand Up @@ -45,12 +46,11 @@ describe('e2e-local', () => {
let serverLogs = '';

beforeAll(async () => {
const workingDir = path.resolve('../../')
console.log(`Starting server process on ${workingDir}`);
console.log(`Starting server process on ${CURRENT_WORKING_DIR}`);
// Place Azure Functions into the current directory
const command = DEBUG ? ['sleep', '60'] : ['func', 'start', '--verbose'];
const serverProcess = Bun.spawn(command, {
cwd: workingDir,
cwd: CURRENT_WORKING_DIR,
stdout: 'inherit',
onExit(proc, exitCode, signalCode, error) {
if (exitCode !== 0) {
Expand Down

0 comments on commit 569d4e9

Please sign in to comment.