Bump actions/checkout from 3 to 4 #533
Workflow file for this run
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 action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
# 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 | |
runs-on: ubuntu-22.04 | |
# do a matrix test with different node versions | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [14.x, 16.x, 18.x, 20.x] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# try to perform a nodejs setup | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# docker test | |
- name: install+run docker-unifi-controller | |
run: | | |
# create docker-unifi-controller | |
docker create --name=unifi-controller -e PUID=1001 -e PGID=116 -e MEM_LIMIT=1024 -e MEM_STARTUP=1024 -e TZ=Etc/UTC -p 8443:8443 -p 8080:8080 -v $GITHUB_WORKSPACE/unifi-storage:/config lscr.io/linuxserver/unifi-controller:latest | |
# do an initial startup to create databse&co | |
docker start unifi-controller | |
sleep 10 | |
# stop the unifi-controller right away and | |
# install our own demo database instead | |
docker stop unifi-controller | |
sudo rm -rf unifi-storage/data | |
sudo tar -C unifi-storage -xf $GITHUB_WORKSPACE/.github/workflows/db-demo-dump.tar.bz2 | |
# final unifi-controller startup | |
docker start unifi-controller | |
# wait for unifi-controller to be ready | |
while ! curl -ks https://127.0.0.1:8443; do echo waiting for unifi-controller; ((c++)) && ((c==10)) && break; sleep 3; done | |
# wait some more time to let the unifi network app settle | |
sleep 20 | |
# remote debug tmate session | |
- name: debug tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} | |
# run npm tests | |
- name: npm install, build, and test | |
run: | | |
npm install | |
npm run build --if-present | |
npm test | |
env: | |
CI: true |