Skip to content

build(deps): bump softprops/action-gh-release from 1 to 2 #363

build(deps): bump softprops/action-gh-release from 1 to 2

build(deps): bump softprops/action-gh-release from 1 to 2 #363

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
branches:
- 'master'
# Commit SHAs may differ when trigger via pull request vs workflow_dispatch, ensure the correct commit is referenced.
env:
commit_id: "${{ github.event.pull_request.head.sha || github.sha }}"
build_version: "0.0_0dev_${{ github.event.pull_request.head.sha || github.sha }}"
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
include:
- freebsd_version: FreeBSD-14.0-CURRENT
freebsd_id: freebsd14
- freebsd_version: FreeBSD-15.0-CURRENT
freebsd_id: freebsd15
steps:
- uses: actions/checkout@v4
- name: Setup FreeBSD build VM
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.freebsd_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.freebsd_version }} restore initial
/usr/local/bin/VBoxManage startvm ${{ matrix.freebsd_version }} --type headless
sleep 5
- name: Build pfSense-pkg-API on FreeBSD
run: |
/usr/bin/ssh -o StrictHostKeyChecking=no ${{ matrix.freebsd_version }}.jaredhendrickson.com 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true'
/usr/local/bin/python3 tools/make_package.py --host ${{ matrix.freebsd_version }}.jaredhendrickson.com --branch ${{ env.commit_id }} --tag ${{ env.build_version }}_${{ matrix.freebsd_id }}
- name: Teardown FreeBSD build VM
if: "${{ always() }}"
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.freebsd_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{matrix.freebsd_version}} restore initial
- uses: actions/upload-artifact@v4
with:
name: pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg
path: pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg
e2e_tests:
runs-on: self-hosted
needs: [build]
strategy:
matrix:
include:
- pfsense_version: pfSense-2.7.1-RELEASE
freebsd_id: freebsd14
- pfsense_version: pfSense-2.7.2-RELEASE
freebsd_id: freebsd14
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg
path: pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg
- name: Setup pfSense VM
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.pfsense_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.pfsense_version }} restore initial
/usr/local/bin/VBoxManage startvm ${{ matrix.pfsense_version }} --type headless
sleep 5
# This is only necessary until GitHub Actions allows an easier way to get a URL to download the artifact within pfSense
- name: Copy pfSense-pkg-API build to pfSense
run: |
pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k
pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k
scp -o StrictHostKeyChecking=no pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg/pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg admin@${{ matrix.pfsense_version }}.jaredhendrickson.com:/tmp/
- name: Install pfSense-pkg-API on pfSense
run: |
/usr/local/bin/pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com --no_verify -c "pkg -C /dev/null add /tmp/pfSense-pkg-API-${{ env.build_version }}_${{ matrix.freebsd_id }}.pkg" -u admin -p pfsense
/usr/local/bin/pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com --no_verify -c '/etc/rc.restart_webgui' -u admin -p pfsense || true
sleep 10
- name: Run pfSense-pkg-API E2E tests
run: |
python3 tests/run_all_tests.py --host ${{ matrix.pfsense_version }}.jaredhendrickson.com
- name: Teardown pfSense VM
if: "${{ always() }}"
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.pfsense_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.pfsense_version }} restore initial