Update vmactions/freebsd-vm from base vm #648
This file contains hidden or 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: Test | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [ published ] | |
| push: | |
| branches: | |
| - '*' | |
| paths: | |
| - '**.sh' | |
| - '.github/workflows/test.yml' | |
| - 'index.js' | |
| - 'conf/*' | |
| - 'hooks/*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| testsshfs: | |
| if: ${{ !contains(github.repository, 'dragonflybsd') && !contains(github.repository, 'solaris') && !contains(github.repository, 'omnios') && !contains(github.repository, 'haiku')}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| release: [ "13.2", "13.3", "13.4", "13.5", "14.0", "14.1", "14.2", "14.3", "15.0" | |
| , ""] | |
| arch: [ "aarch64", "", "riscv64"] | |
| runs: [ "ubuntu-24.04", "ubuntu-24.04-arm"] | |
| exclude: | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "" | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "riscv64" | |
| - release: "13.2" | |
| arch: aarch64 | |
| - release: "13.2" | |
| arch: riscv64 | |
| - release: "12.4" | |
| arch: aarch64 | |
| - release: "12.4" | |
| arch: riscv64 | |
| - release: "14.0" | |
| arch: aarch64 | |
| - release: "14.0" | |
| arch: riscv64 | |
| - release: "14.1" | |
| arch: riscv64 | |
| - release: "13.3" | |
| arch: riscv64 | |
| runs-on: ${{ matrix.runs }} | |
| name: sshfs FreeBSD | |
| env: | |
| MYTOKEN : ${{ secrets.MYTOKEN }} | |
| MYTOKEN2: "value2" | |
| DEBUG: 1 | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check arch | |
| id: check | |
| run: | | |
| _release="${{ matrix.release }}" | |
| if [ -z "$_release" ]; then | |
| . conf/default.release.conf | |
| _release="$DEFAULT_RELEASE" | |
| fi | |
| _arch="${{ matrix.arch }}" | |
| if [ "${_arch}" = "x86_64" ]; then | |
| _arch="" | |
| fi | |
| if [ -z "${_arch}" ]; then | |
| #ok, go ahead | |
| echo "arch is empty" | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| elif [ -e "conf/${_release}-${_arch}.conf" ]; then | |
| echo "conf exists: conf/${_release}-${_arch}.conf" | |
| #ok, go ahead | |
| if [[ "$(echo "FreeBSD" | tr '[:upper:]' '[:lower:]')-${_arch}" == "freebsd-riscv64" ]]; then | |
| echo "The FreeBSD-${_arch} doesn't support sshfs, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "The release ${_release} doesn't support ${_arch}, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| fi | |
| # - name: Creating Web console | |
| # if: ${{ steps.check.outputs.run == 'true' }} | |
| # uses: vmactions/cf-tunnel@v0 | |
| # id: tunnel | |
| # with: | |
| # protocol: http | |
| # port: 8000 | |
| - name: Test in FreeBSD | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| id: test | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| envs: 'DEBUG MYTOKEN MYTOKEN2' | |
| prepare: | | |
| mem: 4096 | |
| release: ${{ matrix.release }} | |
| arch: ${{ matrix.arch }} | |
| nat: | | |
| "20022": "22" | |
| "8080": "80" | |
| "8443": "443" | |
| udp:"8081": "80" | |
| usesh: true | |
| debug: true | |
| sync: sshfs | |
| run: | | |
| set -e | |
| ls -lah $HOME/work | |
| if [ -z "$(ls -A $HOME/work)" ]; then | |
| echo "sshfs error." | |
| exit 1 | |
| fi | |
| echo "TEST_ENV=abc" >>${GITHUB_ENV} | |
| echo "textfromvm" >$GITHUB_WORKSPACE/vm.txt | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| - name: Test NAT | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| env: | |
| VM_USER: "" | |
| run: | | |
| set -e | |
| echo "TEST_ENV=$TEST_ENV" | |
| [ "$TEST_ENV" = "abc" ] | |
| ssh -v -p 20022 ${VM_USER:-root}@localhost "uname -a;whoami;pwd" | |
| - name: Test custom shell | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| shell: freebsd {0} | |
| run: | | |
| pwd | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| testnfs: | |
| if: ${{!contains(github.repository, 'haiku')}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| release: [ "13.2", "13.3", "13.4", "13.5", "14.0", "14.1", "14.2", "14.3", "15.0" | |
| , ""] | |
| arch: [ "aarch64", "", "riscv64"] | |
| runs: [ "ubuntu-24.04", "ubuntu-24.04-arm"] | |
| exclude: | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "" | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "riscv64" | |
| - release: "13.2" | |
| arch: aarch64 | |
| - release: "13.2" | |
| arch: riscv64 | |
| - release: "12.4" | |
| arch: aarch64 | |
| - release: "12.4" | |
| arch: riscv64 | |
| - release: "14.0" | |
| arch: aarch64 | |
| - release: "14.0" | |
| arch: riscv64 | |
| - release: "14.1" | |
| arch: riscv64 | |
| - release: "13.3" | |
| arch: riscv64 | |
| runs-on: ${{ matrix.runs }} | |
| name: nfs FreeBSD | |
| env: | |
| MYTOKEN : ${{ secrets.MYTOKEN }} | |
| MYTOKEN2: "value2" | |
| DEBUG: 1 | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check arch | |
| id: check | |
| run: | | |
| _release="${{ matrix.release }}" | |
| if [ -z "$_release" ]; then | |
| . conf/default.release.conf | |
| _release="$DEFAULT_RELEASE" | |
| fi | |
| _arch="${{ matrix.arch }}" | |
| if [ "${_arch}" = "x86_64" ]; then | |
| _arch="" | |
| fi | |
| if [ -z "${_arch}" ]; then | |
| #ok, go ahead | |
| echo "arch is empty" | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| elif [ -e "conf/${_release}-${_arch}.conf" ]; then | |
| #ok, go ahead | |
| echo "conf exists: conf/${_release}-${_arch}.conf" | |
| if [[ "$(echo "FreeBSD" | tr '[:upper:]' '[:lower:]')-${_arch}" == "freebsd-riscv64" ]]; then | |
| echo "The FreeBSD-${_arch} doesn't support nfs, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "The release ${_release} doesn't support ${_arch}, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| fi | |
| # - name: Creating Web console | |
| # if: ${{ steps.check.outputs.run == 'true' }} | |
| # uses: vmactions/cf-tunnel@v0 | |
| # id: tunnel | |
| # with: | |
| # protocol: http | |
| # port: 8000 | |
| - name: Test in FreeBSD | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| id: test | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| envs: 'DEBUG MYTOKEN MYTOKEN2' | |
| prepare: | | |
| mem: 4096 | |
| release: ${{ matrix.release }} | |
| arch: ${{ matrix.arch }} | |
| nat: | | |
| "20022": "22" | |
| "8080": "80" | |
| "8443": "443" | |
| udp:"8081": "80" | |
| usesh: true | |
| debug: true | |
| sync: nfs | |
| run: | | |
| ls -lah $HOME/work | |
| tree $HOME/work/ | |
| if [ -z "$(ls -A $HOME/work)" ]; then | |
| echo "nfs error." | |
| exit 1 | |
| fi | |
| env | |
| echo "TEST_ENV=abc" >>${GITHUB_ENV} | |
| echo "textfromvm" >$GITHUB_WORKSPACE/vm.txt | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| - name: Test NAT | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| env: | |
| VM_USER: "" | |
| run: | | |
| set -e | |
| [ -e "$GITHUB_WORKSPACE/vm.txt" ]; | |
| cat "$GITHUB_WORKSPACE/vm.txt"; | |
| grep "textfromvm" $GITHUB_WORKSPACE/vm.txt; | |
| echo "TEST_ENV=$TEST_ENV" | |
| [ "$TEST_ENV" = "abc" ] | |
| ssh -v -p 20022 ${VM_USER:-root}@localhost "uname -a;whoami;pwd" | |
| - name: Test custom shell | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| shell: freebsd {0} | |
| run: | | |
| pwd | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| testscp: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| release: [ "13.2", "13.3", "13.4", "13.5", "14.0", "14.1", "14.2", "14.3", "15.0" | |
| , ""] | |
| arch: [ "aarch64", "", "riscv64"] | |
| runs: [ "ubuntu-24.04", "ubuntu-24.04-arm"] | |
| exclude: | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "" | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "riscv64" | |
| - release: "13.2" | |
| arch: aarch64 | |
| - release: "13.2" | |
| arch: riscv64 | |
| - release: "12.4" | |
| arch: aarch64 | |
| - release: "12.4" | |
| arch: riscv64 | |
| - release: "14.0" | |
| arch: aarch64 | |
| - release: "14.0" | |
| arch: riscv64 | |
| - release: "14.1" | |
| arch: riscv64 | |
| - release: "13.3" | |
| arch: riscv64 | |
| runs-on: ${{ matrix.runs }} | |
| name: scp FreeBSD | |
| env: | |
| MYTOKEN : ${{ secrets.MYTOKEN }} | |
| MYTOKEN2: "value2" | |
| DEBUG: 1 | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check arch | |
| id: check | |
| run: | | |
| _release="${{ matrix.release }}" | |
| if [ -z "$_release" ]; then | |
| . conf/default.release.conf | |
| _release="$DEFAULT_RELEASE" | |
| fi | |
| _arch="${{ matrix.arch }}" | |
| if [ "${_arch}" = "x86_64" ]; then | |
| _arch="" | |
| fi | |
| if [ -z "${_arch}" ]; then | |
| #ok, go ahead | |
| echo "arch is empty" | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| elif [ -e "conf/${_release}-${_arch}.conf" ]; then | |
| #ok, go ahead | |
| echo "conf exists: conf/${_release}-${_arch}.conf" | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "The release ${_release} doesn't support ${_arch}, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| fi | |
| # - name: Creating Web console | |
| # if: ${{ steps.check.outputs.run == 'true' }} | |
| # uses: vmactions/cf-tunnel@v0 | |
| # id: tunnel | |
| # with: | |
| # protocol: http | |
| # port: 8000 | |
| - name: Test in FreeBSD | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| id: test | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| envs: 'DEBUG MYTOKEN MYTOKEN2' | |
| prepare: | | |
| mem: 4096 | |
| release: ${{ matrix.release }} | |
| arch: ${{ matrix.arch }} | |
| nat: | | |
| "20022": "22" | |
| "8080": "80" | |
| "8443": "443" | |
| udp:"8081": "80" | |
| usesh: true | |
| debug: true | |
| sync: scp | |
| run: | | |
| ls -lah $HOME/work | |
| #don't use tree here, freebsd riscv64 doesn't have a tree | |
| #tree $HOME/work/ | |
| if [ -z "$(ls -A $HOME/work)" ]; then | |
| echo "nfs error." | |
| exit 1 | |
| fi | |
| env | |
| echo "TEST_ENV=abc" >>${GITHUB_ENV} | |
| echo "textfromvm" >$GITHUB_WORKSPACE/vm.txt | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| - name: Test files | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| env: | |
| VM_USER: "" | |
| run: | | |
| set -e | |
| [ -e "$GITHUB_WORKSPACE/vm.txt" ]; | |
| cat "$GITHUB_WORKSPACE/vm.txt"; | |
| grep "textfromvm" $GITHUB_WORKSPACE/vm.txt; | |
| cat ${GITHUB_ENV} | |
| echo "TEST_ENV=$TEST_ENV"; | |
| [ "$TEST_ENV" = "abc" ]; | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| release: [ "13.2", "13.3", "13.4", "13.5", "14.0", "14.1", "14.2", "14.3", "15.0" | |
| , ""] | |
| arch: [ "aarch64", "", "riscv64"] | |
| runs: [ "ubuntu-24.04", "ubuntu-24.04-arm"] | |
| disableCache: [ "", "true"] | |
| exclude: | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "" | |
| - runs: "ubuntu-24.04-arm" | |
| arch: "riscv64" | |
| - release: "13.2" | |
| arch: aarch64 | |
| - release: "13.2" | |
| arch: riscv64 | |
| - release: "12.4" | |
| arch: aarch64 | |
| - release: "12.4" | |
| arch: riscv64 | |
| - release: "14.0" | |
| arch: aarch64 | |
| - release: "14.0" | |
| arch: riscv64 | |
| - release: "14.1" | |
| arch: riscv64 | |
| - release: "13.3" | |
| arch: riscv64 | |
| runs-on: ${{ matrix.runs }} | |
| name: rsync default FreeBSD | |
| env: | |
| MYTOKEN : ${{ secrets.MYTOKEN }} | |
| MYTOKEN2: "value2" | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check arch | |
| id: check | |
| run: | | |
| _release="${{ matrix.release }}" | |
| if [ -z "$_release" ]; then | |
| . conf/default.release.conf | |
| _release="$DEFAULT_RELEASE" | |
| fi | |
| _arch="${{ matrix.arch }}" | |
| if [ "${_arch}" = "x86_64" ]; then | |
| _arch="" | |
| fi | |
| if [ -z "${_arch}" ]; then | |
| #ok, go ahead | |
| echo "arch is empty" | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| elif [ -e "conf/${_release}-${_arch}.conf" ]; then | |
| #ok, go ahead | |
| echo "conf exists: conf/${_release}-${_arch}.conf" | |
| if [[ "$(echo "FreeBSD" | tr '[:upper:]' '[:lower:]')-${_arch}" == "freebsd-riscv64" ]]; then | |
| echo "The FreeBSD-${_arch} doesn't support rsync, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "The release ${_release} doesn't support ${_arch}, skip." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test in FreeBSD | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| id: test | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| envs: 'MYTOKEN MYTOKEN2' | |
| prepare: | | |
| mem: 4096 | |
| release: ${{ matrix.release }} | |
| arch: ${{ matrix.arch }} | |
| nat: | | |
| "20022": "22" | |
| "8080": "80" | |
| "8443": "443" | |
| udp:"8081": "80" | |
| usesh: true | |
| debug: true | |
| disable-cache: ${{ matrix.disableCache }} | |
| run: | | |
| env | |
| echo "TEST_ENV=abc" >>${GITHUB_ENV} | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| - name: Test NAT | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| env: | |
| VM_USER: "" | |
| run: | | |
| set -e | |
| echo "TEST_ENV=$TEST_ENV" | |
| [ "$TEST_ENV" = "abc" ] | |
| ssh -v -p 20022 ${VM_USER:-root}@localhost "uname -a;whoami;pwd" | |
| - name: Test custom shell | |
| if: ${{ steps.check.outputs.run == 'true' }} | |
| shell: freebsd {0} | |
| run: | | |
| pwd | |
| #pkg install -y curl | |
| pwd | |
| ls -lah | |
| whoami | |
| env | |
| freebsd-version | |
| uname -a | |
| #sysctl hw.model | |
| sysctl hw.ncpu | |
| sysctl hw.physmem | |
| sysctl hw.usermem | |
| testerr: | |
| strategy: | |
| fail-fast: false | |
| runs-on: ubuntu-24.04 | |
| name: test default error FreeBSD | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Test in FreeBSD | |
| id: testerr | |
| continue-on-error: true | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| usesh: true | |
| debug: true | |
| run: | | |
| echo "this is an error" | |
| false | |
| - name: Verify that the previous step failed | |
| if: steps.testerr.outcome != 'failure' | |
| run: | | |
| echo "The step was expected to fail, but it succeeded!" | |
| exit 1 | |
| - name: Verify that the previous step succeeded | |
| if: steps.testerr.outcome == 'failure' | |
| run: | | |
| echo "The step was expected to fail, and it failed!" | |
| exit 0 | |
| testpass: | |
| strategy: | |
| fail-fast: false | |
| runs-on: ubuntu-24.04 | |
| name: test default success FreeBSD | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Test in FreeBSD | |
| id: testpass | |
| continue-on-error: true | |
| uses: vmactions/freebsd-vm@67d002bdf07a317b7fc16822e53b538c0a57c1e7 | |
| with: | |
| usesh: true | |
| debug: true | |
| run: | | |
| echo "this is a normal command" | |
| true | |
| - name: Verify that the previous step succeeded | |
| if: steps.testpass.outcome != 'success' | |
| run: | | |
| echo "The step was expected to succeed, but it failed!" | |
| exit 1 | |
| - name: Verify that the previous step failed | |
| if: steps.testpass.outcome == 'success' | |
| run: | | |
| echo "The step was expected to succeed, and it succeeded!" | |
| exit 0 | |