| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- name: Test Install Script
- run-name: "Install Test: ${{ github.event_name == 'pull_request' && format('PR #{0}', github.event.pull_request.number) || github.ref_name }} | ${{ github.event.head_commit.message || github.event.pull_request.title || 'Manual trigger' }} by ${{ github.actor }}"
- on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
- paths:
- - 'install.sh'
- - '.github/workflows/test-install.yml'
- jobs:
- test-install-script:
- name: Test on ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- env:
- # Remote installer from the current repository and commit
- RAW_URL: ${{ format('https://raw.githubusercontent.com/{0}/{1}/install.sh', github.repository, github.sha) }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
- steps:
- - name: Test install script help
- run: curl -fsSL "$RAW_URL" | sh -s -- --help
- - name: Test with bash (if available)
- run: curl -fsSL "$RAW_URL" | bash -s -- --help
- - name: Test install latest
- run: curl -fsSL "$RAW_URL" | sh
- - name: Check DDNS
- run: ddns --version
- - name: Test uninstall
- run: curl -fsSL "$RAW_URL" | sh -s -- --uninstall
- - name: Test install beta with language detection (zh_CN)
- run: curl -fsSL "$RAW_URL" | LANG=zh_CN.UTF-8 sh -s -- beta
- - name: Test install help with language detection (zh_CN)
- run: curl -fsSL "$RAW_URL" | LANG=zh_CN.UTF-8 sh -s -- --help
- - name: Check DDNS
- run: ddns --version
- - name: Test uninstall
- run: curl -fsSL "$RAW_URL" | sh -s -- --uninstall
- - name: Test install location by wget
- run: wget -qO - "$RAW_URL" | sh -s -- --install-dir /tmp/ddns
- - name: Check DDNS in custom location
- run: /tmp/ddns/ddns --version
- test-with-container:
- name: Test on Container (${{ matrix.container }})
- runs-on: ubuntu-latest
- strategy:
- matrix:
- container:
- - alpine:latest
- - debian:latest
- - openwrt/rootfs:latest
- container: ${{ matrix.container }}
- env:
- # Remote installer from the current repository and commit
- RAW_URL: ${{ format('https://raw.githubusercontent.com/{0}/{1}/install.sh', github.repository, github.sha) }}
- steps:
- - name: install wget
- if: matrix.container == 'debian:latest'
- run: apt-get update && apt-get install -y wget
- - name: Download install script
- run: wget "$RAW_URL" && chmod +x install.sh
- - name: Test install script help
- run: ./install.sh --help
- - name: Test install latest
- run: ./install.sh
- - name: Check DDNS
- run: ddns --version
- - name: Test uninstall
- run: ./install.sh --uninstall
- - name: Test install beta with language detection (zh_CN)
- run: LANG=zh_CN.UTF-8 ./install.sh beta
- - name: Check DDNS
- run: ddns --version
- - name: Test uninstall
- run: ./install.sh --uninstall
|