Merge pull request #307 from grahambates/exception_mask_default #311
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 is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Setup xvfb (Linux) | |
run: sudo apt-get update; sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libopenal-dev libalut-dev libsdl2-2.0-0 libpng-dev mpeg2dec libmpeg2-4 libmpeg2-4-dev libsdl2-dev libsdl2-ttf-2.0-0 libopenal-dev libopenal-data libopenal1 | |
if: runner.os == 'Linux' | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18.x | |
- run: npm install | |
- run: npm run test-compile | |
- name: xvfb test | |
uses: GabrielBB/xvfb-action@v1.5 | |
with: | |
run: npm run test | |
options: -screen 0 1600x1200x24 | |
if: runner.os == 'Linux' | |
- name: test | |
run: npm run test | |
if: runner.os != 'Linux' | |
env: | |
DISABLE_COVERAGE: true | |
- name: Rename Unit Test Results | |
if: always() | |
run: mv test-results.xml test-results-${{ matrix.os }}.xml | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Unit Test Results | |
path: test-results*.xml | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
if: runner.os == 'Linux' | |
# - name: Setup tmate session | |
# if: success() || failure() | |
# uses: mxschmitt/action-tmate@v3 | |
package: | |
needs: build | |
# The type of runner that the job will run on | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- run: npm install | |
- name: Install vsce | |
run: npm install -g vsce | |
- run: npm run vscode:prepublish | |
- run: vsce package | |
- uses: actions/upload-artifact@v2 | |
if: ${{ success() }} | |
with: | |
name: Extension | |
path: ./*.vsix | |
publish-test-results: | |
name: "Publish Unit Tests Results" | |
needs: build | |
runs-on: ubuntu-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v1 | |
with: | |
files: artifacts/**/*.xml |