Skip to content

Commit

Permalink
Run VSIX tests on all platforms (Azure#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenglol authored Nov 17, 2020
1 parent 0eeab14 commit 7f8fb6e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.bicep -text
*.bicep -text
*.ts text eol=lf
28 changes: 26 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,24 @@ jobs:

build-vsix:
name: 'Build VSIX'
runs-on: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
needs: build-bicep

env:
CI: true

strategy:
fail-fast: false
matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]
include:
- os: 'windows-latest'
rid: 'win-x64'
- os: 'ubuntu-latest'
rid: 'linux-x64'
- os: 'macos-latest'
rid: 'osx-x64'

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -149,9 +164,16 @@ jobs:
- name: Run unit tests
run: npm run test:unit
working-directory: ./src/vscode-bicep

- name: Run E2E tests
run: npm run test:e2e
if: runner.os != 'Linux'
working-directory: ./src/vscode-bicep

# In headless Linux CI machines xvfb is required to run VS Code, so need a separate path for Linux.
- name: Run E2E tests (Linux)
run: xvfb-run -a npm run test:e2e
if: runner.os == 'Linux'
working-directory: ./src/vscode-bicep

- name: Upload Code Coverage
Expand All @@ -162,10 +184,12 @@ jobs:

- name: Create VSIX
run: npm run package
if: runner.os == 'Linux'
working-directory: ./src/vscode-bicep

- name: Upload VSIX
uses: actions/upload-artifact@v2
if: runner.os == 'Linux'
with:
name: vscode-bicep.vsix
path: ./src/vscode-bicep/vscode-bicep.vsix
Expand Down
2 changes: 2 additions & 0 deletions src/vscode-bicep/src/test/e2e/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ async function go() {
extensionTestsPath: path.resolve(__dirname, "index"),
launchArgs: ["--enable-proposed-api"],
});

process.exit(0);
} catch (err) {
console.error(err);
process.exit(1);
Expand Down

0 comments on commit 7f8fb6e

Please sign in to comment.