diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c2598d3d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,108 @@ +name: CI-Tests +on: + push: + branches: + - master + - develop + tags: + - v* + pull_request: + branches: + - master + - develop + + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + + steps: + - name: checkout + uses: actions/checkout@v2 + - name: get node + uses: actions/setup-node@v1 + with: + node-version: 11.x + - name: linux setup + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0 + sleep 3 + wget https://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz -P /home/$USER + tar -xvf /home/$USER/arduino-1.8.2-linux64.tar.xz -C /home/$USER/ + sudo ln -s /home/$USER/arduino-1.8.2/arduino /usr/bin/arduino + sudo apt-get update + sudo apt-get install g++-multilib + sudo apt-get install -y build-essential + sudo apt-get install libudev-dev + - name: macos setup + if: ${{ matrix.os == 'macos-latest' }} + run: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + brew install arduino --cask + - name: preinstall + run: | + npm install -g node-gyp + npm install -g vsce + npm install -g gulp + - name: install + run: npm install + - name: scripts + run: | + gulp tslint + gulp genAikey + vsce package + - name: run tests + if: ${{ matrix.os != 'windows-latest' }} + uses: GabrielBB/xvfb-action@v1 + with: + run: npm test --silent + + deploy: + needs: build + runs-on: ubuntu-latest + environment: vsix-publishing + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - run: echo ${{env.VERSION}} + - name: Checkout + uses: actions/checkout@v2 + - name: get node + uses: actions/setup-node@v1 + with: + node-version: 11.x + - name: linux setup + run: | + export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0 + sleep 3 + sudo apt-get update + sudo apt-get install g++-multilib + sudo apt-get install -y build-essential + sudo apt-get install libudev-dev + - name: preinstall + run: | + npm install -g node-gyp + npm install -g vsce + npm install -g gulp + - name: install + run: npm install + - name: scripts + run: | + gulp tslint + gulp genAikey + vsce package + - name: upload .vsix to github tag + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.OAUTH_TOKEN }} + file: ${{github.workspace}}/vscode-arduino*.vsix + tag: ${{ github.ref }} + overwrite: true + file_glob: true + - name: publish + if: github.ref == 'refs/tags/[0-9].[0-9].[0-9]' + run: vsce publish -p ${{ secrets.VSCE_TOKEN }} diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 1787d9e2..10c0b252 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -16,7 +16,7 @@ jobs: stale-issue-message: 'This issue has been automatically marked as stale because it has no recent activities. It will be closed if no further activity occurs within 3 days. Thank you for your contributions.' stale-issue-label: 'stale' days-before-stale: 7 - only-labels: 'need more info' + only-labels: 'needs more info' last-updated-user-type: 'collaborator' days-before-close: 3 operations-per-run: 150 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3b12a659..00000000 --- a/.travis.yml +++ /dev/null @@ -1,89 +0,0 @@ -language: node_js - -node_js: -- '11' - -os: -- windows -- linux -- osx -dist: trusty # using Ubuntu 14.04.5 LTS - -# fixing https://github.com/Microsoft/vscode/issues/33998 -addons: - apt: - sources: - # https://docs.travis-ci.com/user/languages/c/#GCC-on-Linux - - ubuntu-toolchain-r-test - packages: - - libsecret-1-dev - - g++-4.9 - -branches: - only: - - master - - develop - - /v?[0-9]+\.[0-9]+\.[0-9]+(.*)?/ - -env: - global: - - ISPRODTAG=^v?[0-9]+\.[0-9]+\.[0-9]+$ - -before_install: -- if [ $TRAVIS_OS_NAME == "linux" ]; then - export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - sleep 3; - wget https://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz -P /home/$USER; - tar -xvf /home/$USER/arduino-1.8.2-linux64.tar.xz -C /home/$USER/; - sudo ln -s /home/$USER/arduino-1.8.2/arduino /usr/bin/arduino; - sudo apt-get update; - sudo apt-get install g++-multilib; - sudo apt-get install -y build-essential; - sudo apt-get install libudev-dev; - fi -# Arduino 1.8.7 has breaking change, Install board package and library will fail -# https://github.com/arduino/Arduino/issues/8034 -# Arduino 1.8.8 has fixed issue 8034. -- if [ $TRAVIS_OS_NAME == "osx" ]; then - /usr/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; - brew install --cask arduino; - fi -- npm install -g node-gyp -- npm install -g vsce -- npm install -g gulp -- npm install -g typescript - -install: -- npm install -# https://github.com/travis-ci/travis-ci/issues/8813 -- rm -f ./node_modules/.bin/which - -script: -- gulp tslint -- gulp genAikey -- vsce package -- if [ $TRAVIS_OS_NAME == "linux" ] || [ $TRAVIS_OS_NAME == "osx" ]; then - npm test --silent; - fi - -deploy: - # deploy to github release - - provider: releases - api_key: $GIT_TOKEN - file_glob: true - file: "*.vsix" - skip_cleanup: true - on: - tags: true - all_branches: true - condition: "$TRAVIS_OS_NAME == linux" - # deploy to vscode extension market - - provider: script - script: vsce publish -p $VSCE_TOKEN --packagePath *.vsix - skip_cleanup: true - on: - tags: true - all_branches: true - # if it's a PROD tag (something like 1.0.0), then publish extension to market. - condition: "$TRAVIS_OS_NAME == linux && $TRAVIS_TAG =~ $ISPRODTAG"