-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] CI: Added tests on OpenBSD & NetBSD
- Loading branch information
1 parent
7087e4a
commit da15069
Showing
5 changed files
with
148 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: 'NetBSD VM' | ||
description: 'Install NetBSD VM with python3, PDM and tox pre-installed' | ||
inputs: | ||
python-version: | ||
description: "Version range or exact version of Python to use, using SemVer's version range syntax." | ||
required: true | ||
run: | ||
description: 'The CI command to run' | ||
required: true | ||
release: | ||
description: 'The release version of NetBSD vm' | ||
required: false | ||
envs: | ||
description: 'The envs to pass into NetBSD vm' | ||
required: false | ||
sync: | ||
description: 'How to synchronize the source code to/from the VM, Values can be: rsync(default), and sshfs' | ||
required: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Load PDM configuration from pdm.conf | ||
uses: cardinalby/export-env-action@v2 | ||
with: | ||
envFile: .github/actions/pdm.conf | ||
- name: Load Python configuration | ||
uses: cardinalby/export-env-action@v2 | ||
with: | ||
envFile: ${{ github.action_path }}/python/${{ inputs.python-version }}.conf | ||
- name: Run on VM | ||
uses: vmactions/netbsd-vm@v1 | ||
with: | ||
release: ${{ inputs.release }} | ||
usesh: true | ||
envs: ${{ inputs.envs }} | ||
sync: ${{ inputs.sync }} | ||
prepare: | | ||
set -e | ||
/usr/sbin/pkg_add -v pkgin | ||
pkgin update | ||
pkgin -y install curl git ${{ env.NETBSD_PORTS_FOR_PYTHON }} | ||
curl -sSL https://pdm-project.org/install-pdm.py | ${{ env.NETBSD_PYTHON_BIN }} - --version=${{ env.PDM_VERSION }} --path=/usr/local | ||
pdm config check_update false | ||
pdm config install.cache true | ||
run: | | ||
set -e | ||
pdm install --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox | ||
tox --version | ||
${{ inputs.run }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Install python and all optional dependencies | ||
NETBSD_PORTS_FOR_PYTHON="python311-*" | ||
NETBSD_PYTHON_BIN=python3.11 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'OpenBSD VM' | ||
description: 'Install OpenBSD VM with python3, PDM and tox pre-installed' | ||
inputs: | ||
python-version: | ||
description: "Version range or exact version of Python to use, using SemVer's version range syntax." | ||
required: true | ||
run: | ||
description: 'The CI command to run' | ||
required: true | ||
release: | ||
description: 'The release version of OpenBSD vm' | ||
required: false | ||
envs: | ||
description: 'The envs to pass into OpenBSD vm' | ||
required: false | ||
sync: | ||
description: 'How to synchronize the source code to/from the VM, Values can be: rsync(default), and sshfs' | ||
required: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Load PDM configuration from pdm.conf | ||
uses: cardinalby/export-env-action@v2 | ||
with: | ||
envFile: .github/actions/pdm.conf | ||
- name: Load Python configuration | ||
uses: cardinalby/export-env-action@v2 | ||
with: | ||
envFile: ${{ github.action_path }}/python/${{ inputs.python-version }}.conf | ||
- name: Run on VM | ||
uses: vmactions/openbsd-vm@v1 | ||
with: | ||
release: ${{ inputs.release }} | ||
usesh: true | ||
envs: ${{ inputs.envs }} | ||
sync: ${{ inputs.sync }} | ||
prepare: | | ||
set -e | ||
pkg_add -v -r curl git ${{ env.OPENBSD_PORTS_FOR_PYTHON }} | ||
curl -sSL https://pdm-project.org/install-pdm.py | ${{ env.OPENBSD_PYTHON_BIN }} - --version=${{ env.PDM_VERSION }} --path=/usr/local | ||
pdm config check_update false | ||
pdm config install.cache true | ||
run: | | ||
set -e | ||
pdm install --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox | ||
tox --version | ||
${{ inputs.run }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OPENBSD_PORTS_FOR_PYTHON=python-3.11.10p1 | ||
OPENBSD_PYTHON_BIN=python3.11 |
This file contains 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