Skip to content

Merge pull request #357 from PierreBeucher/self-hosted-runners #836

Merge pull request #357 from PierreBeucher/self-hosted-runners

Merge pull request #357 from PierreBeucher/self-hosted-runners #836

Workflow file for this run

name: Build and Test
on:
push:
branches:
- "master"
pull_request:
branches:
- master
env:
CLOUDYPAD_BUILD_CORE_IMAGE_TAG: ${{ github.head_ref || 'master' }}
CLOUDYPAD_BUILD_SUNSHINE_IMAGE_TAG: ${{ github.head_ref || 'master' }}
jobs:
unit-test:
name: Unit tests
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: nix develop -c pnpm i
- name: Run standard unit tests
run: nix develop -c task test-unit
build:
name: Build Core container image
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: test analytics key match
run: nix develop -c task test-analytics-key-match
- name: Build container image
run: nix develop -c task build-core-container-ci
- name: Smoke test container image
run: nix develop -c task test-container-smoke-test
- name: Push image as dev (master branch only)
if: github.ref == 'refs/heads/master'
run: nix develop -c task build-core-container-push-current-as-dev
build-sunshine:
name: Build Sunshine container image
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Build container image
run: nix develop -c task build-sunshine-container-ci
- name: Push image as dev (master branch only)
if: github.ref == 'refs/heads/master'
run: nix develop -c task build-sunshine-container-push-current-as-dev
test-install:
name: Test install/run Ubuntu
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
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Test the install script and cloudypad.sh for current commit
- name: Run install script
shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | bash
echo " ==== .bashrc content ==="
cat ~/.bashrc
echo " ==== .bashrc content ==="
bash -i -c 'echo $PATH && which cloudypad'
test-install-macos:
name: Test install/run MacOS
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:
- macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Test the install script and cloudypad.sh for current commit
- name: Run install script
shell: sh
env:
# Docker is not available on MacOS runner
CLOUDYPAD_INSTALL_SKIP_DOCKER_CHECK: true
# Force step into thinking it runs with default zsh shell
# to emulate real MacOS experience
SHELL: /bin/zsh
run: |
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | zsh
echo " ==== .zshrc content ==="
cat ~/.zshrc
echo " ==== .zshrc content ==="
zsh -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: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: nix build .#
test-doc-links:
name: Test documentation links
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run documentation link check test
run: nix develop -c task test-doc-links