Node CI #541
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
name: Node CI | |
concurrency: | |
group: ci-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
CI: true | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
COVERALLS_GIT_BRANCH: main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
# - name: Setup kernel for react native, increase watchers | |
# run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
# used to centralize the node version across workflows | |
# refs https://arinco.com.au/blog/github-actions-share-environment-variables-across-workflows | |
# refs https://github.com/marketplace/actions/set-environment-variables | |
- name: Set Environment Variables | |
uses: tw3lveparsecs/github-actions-setvars@v0.1 | |
with: | |
envFilePath: ./envvars.for.actions | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
# - name: install wine | |
# run: | | |
# sudo dpkg --add-architecture i386 | |
# sudo apt-get update | |
# sudo apt-get install -f wine-stable wine32 | |
- name: export display | |
run: | | |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
echo ">>> Started xvfb" | |
- name: install | |
run: npm install --legacy-peer-deps | |
- name: test | |
run: npm run coveralls | |
env: | |
DISPLAY: ':99.0' | |
- name: memory leak detection | |
run: npm run test -- --detectLeaks | |
- name: package | |
run: npm run package | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Run cypress (acceptance tests) | |
uses: cypress-io/github-action@v4 | |
env: | |
CYPRESS_BASE_URL: 'http://localhost:3000' | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
with: | |
record: true | |
wait-on: 'http://localhost:3000' | |
install-command: npm install --legacy-peer-deps | |
start: npm run serve | |
browser: chrome | |
headed: true | |
# - name: package for windows | |
# run: npm run package-windows | |
- name: fetch snap file | |
id: snap_file | |
run: echo "::set-output name=name::$(ls dist/*.snap | sed "s/dist\///g" | sed "s/\.snap//g")" | |
# - name: fetch windows file | |
# id: windows_file | |
# run: echo "::set-output name=name::$(ls dist/*.exe | sed "s/dist\///g" | sed "s/\.snap//g")" | |
# - name: Archive windows binary | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: "${{ steps.snap_file.outputs.name }}" | |
# path: "dist/${{ steps.windows_file.outputs.name }}" | |
- name: publish snap edge channel | |
uses: snapcore/action-publish@v1 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} | |
with: | |
store_login: ${{ secrets.STORE_LOGIN }} | |
snap: "dist/${{ steps.snap_file.outputs.name }}.snap" | |
release: edge |