Skip to content

Support rubocop.formatAutocorrectsAll command #46

Support rubocop.formatAutocorrectsAll command

Support rubocop.formatAutocorrectsAll command #46

Workflow file for this run

name: Main
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build Distributables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Compile extension
run: |
yarn install --frozen-lockfile
yarn lint
yarn compile
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.2'
- name: Install a supported version of the RuboCop gem
run: gem install rubocop
- name: Compile Tests
run: |
yarn install --frozen-lockfile
yarn test-compile
- name: Setup GUI Environment
run: |
sudo apt-get update
sudo apt-get install -yq dbus-x11 ffmpeg > /dev/null
mkdir -p ~/bin
mkdir -p ~/var/run
cat <<EOF > ~/bin/xvfb-shim
#! /bin/bash
echo DISPLAY=\$DISPLAY >> ${GITHUB_ENV}
echo XAUTHORITY=\$XAUTHORITY >> ${GITHUB_ENV}
sleep 86400
EOF
chmod a+x ~/bin/xvfb-shim
dbus-launch >> ${GITHUB_ENV}
start-stop-daemon --start --quiet --pidfile ~/var/run/Xvfb.pid --make-pidfile --background --exec /usr/bin/xvfb-run -- ~/bin/xvfb-shim
echo -n "Waiting for Xvfb to start..."
while ! grep -q DISPLAY= ${GITHUB_ENV}; do
echo -n .
sleep 3
done
if: runner.os == 'Linux'
- name: Start Screen Recording
run: |
mkdir -p $PWD/videos-raw
no_close=--no-close # uncomment to see ffmpeg output (i.e. leave stdio open)
start-stop-daemon $no_close --start --quiet --pidfile ~/var/run/ffmpeg.pid --make-pidfile --background --exec /usr/bin/ffmpeg -- -nostdin -f x11grab -video_size 1280x1024 -framerate 10 -i ${DISPLAY}.0+0,0 $PWD/videos-raw/test.mp4
if: runner.os == 'Linux'
- name: Cache VS Code Binary
id: vscode-test
uses: actions/cache@v3
with:
path: .vscode-test/
key: ${{ runner.os }}-vscode-test
- name: Run Tests
run: yarn test
- name: Stop Screen Recording
run: |
start-stop-daemon --stop --pidfile ~/var/run/ffmpeg.pid
sleep 3
mkdir -p $PWD/videos
for f in $PWD/videos-raw/*.mp4; do
out=`basename $f`
ffmpeg -i $f -vf format=yuv420p $PWD/videos/$out
done
if: always() && runner.os == 'Linux'
- name: Archive Screen Recording
uses: actions/upload-artifact@v3
with:
name: videos
path: |
videos/
if: always() && runner.os == 'Linux'
- name: Teardown GUI Environment
run: |
start-stop-daemon --stop --pidfile ~/var/run/Xvfb.pid
kill $DBUS_SESSION_BUS_PID
if: always() && runner.os == 'Linux'