Skip to content

More analytics

More analytics #224

Workflow file for this run

name: Build and Test
on:
push:
branches:
- "master"
pull_request:
branches:
- master
jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v27
- uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package*.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: nix develop -c npm i
- name: Run unit tests
run: nix develop -c task test-unit
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v27
- uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- name: test analytics key match
run: nix develop -c task test-analytics-key-match
- name: Build container image
run: nix develop -c task build-local
- name: Smoke test container image
run: nix develop -c task build-smoke-test
test-install:
name: Test install/run
if: "!startsWith(github.head_ref, 'release/')" # Install test will fail on release branch as version won't mach
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
# - macos-14 # Docker install suported yet
# - macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: (MacOS) Setup Docker
# if: startsWith(matrix.os, 'macos')
# # uses: docker-practice/actions-setup-docker@master
# # timeout-minutes: 12
# # uses: douglascamata/setup-docker-macos-action@main
# uses: crazy-max/ghaction-setup-docker@v3
# Test the install script and cloudypad.sh for current commit
- name: Run install script
run: |
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | bash
echo " ==== .bachrc content ==="
cat ~/.bashrc
echo " ==== .bachrc content ==="
bash -i -c 'echo $PATH && which cloudypad'
test-install-container:
name: Test install/run in containers
if: "!startsWith(github.head_ref, 'release/')" # Install test will fail on release branch as version won't mach
runs-on: ubuntu-22.04
# env:
# # Container do not have a tty, this will ensure script behave appropriately
# CLOUDYPAD_CONTAINER_NO_TTY: true
# # Enable debug logs
# CLOUDYPAD_CLI_LAUNCHER_DEBUG: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test install.sh script
run: test/shell/test-install.sh
- name: Test cloudypad.sh script
run: test/shell/test-cloudypad.sh
test-flake-package:
name: Test Flake package
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v27
- run: nix build .#
# Disable this for now as latets version does not respect no-tty properly
# - run: CLOUDYPAD_CONTAINER_NO_TTY=true nix run .# -- --version