From 0656a0ce60adad43e03152395890043d5457fd15 Mon Sep 17 00:00:00 2001 From: Yan Xu Date: Tue, 19 Nov 2024 16:32:08 +0800 Subject: [PATCH] Move test-sdk.yml & test-emitter.yml from Azure Pipeline to GitHub Action (#1405) * Create test-sdk.yml * Rename the action job * Rename the job * Create test-emitter.yml * Update test-emitter.yml --- .github/workflows/test-emitter.yml | 46 ++++++++++++++++++++++++++++++ .github/workflows/test-sdk.yml | 42 +++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/test-emitter.yml create mode 100644 .github/workflows/test-sdk.yml diff --git a/.github/workflows/test-emitter.yml b/.github/workflows/test-emitter.yml new file mode 100644 index 0000000000..680ec8e3ce --- /dev/null +++ b/.github/workflows/test-emitter.yml @@ -0,0 +1,46 @@ +name: test-emitter + +on: + pull_request: + branches: + - main +jobs: + test-emitter: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Install typespec & rush + run: | + npm install -g "@typespec/compiler" + npm install -g @microsoft/rush@5.63.1 + - name: Rush sync-versions + run: | + rush sync-versions + - name: Rush Update + run: | + rush update + - name: Rush Rebuild + run: | + rush rebuild + - name: Run npm install in tests-emitter + working-directory: tests-upgrade/tests-emitter + run: | + npm install + - name: Verify Typespec emitter + shell: pwsh + working-directory: tests-upgrade/tests-emitter + run: | + ./EmitterTest.ps1 -AllowList -SaveResult + - name: Save artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: CompareResult + path: tests-upgrade/tests-emitter/CompareResult + if-no-files-found: warn + retention-days: 7 diff --git a/.github/workflows/test-sdk.yml b/.github/workflows/test-sdk.yml new file mode 100644 index 0000000000..3059934cb2 --- /dev/null +++ b/.github/workflows/test-sdk.yml @@ -0,0 +1,42 @@ +name: test-sdk + +on: + pull_request: + branches: + - main +jobs: + test-sdk: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Install autorest & rush + run: | + npm install -g "autorest" + npm install -g @microsoft/rush@5.63.1 + - name: Rush sync-versions + run: | + rush sync-versions + - name: Rush Update + run: | + rush update + - name: Rush Rebuild + run: | + rush rebuild + - name: Verify SDK generator + shell: pwsh + working-directory: tests-upgrade/tests-sdk1-support + run: | + ./AutoRestSupportSdkTest.ps1 -AllowList -SkipCsharp + - name: Save artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: CompareResult + path: tests-upgrade/tests-sdk1-support/CompareResult + if-no-files-found: warn + retention-days: 7