-
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.
CI: Merged FreeBSD VM setup in a github action (#378)
- Loading branch information
1 parent
1a4a8fc
commit 7087e4a
Showing
6 changed files
with
69 additions
and
38 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,48 @@ | ||
name: 'FreeBSD VM' | ||
description: 'Install FreeBSD 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 FreeBSD vm' | ||
required: false | ||
envs: | ||
description: 'The envs to pass into FreeBSD 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/freebsd-vm@v1 | ||
with: | ||
release: ${{ inputs.release }} | ||
usesh: true | ||
envs: ${{ inputs.envs }} | ||
sync: ${{ inputs.sync }} | ||
prepare: | | ||
set -e | ||
pkg install -y curl git ${{ env.FREEBSD_PORTS_FOR_PYTHON }} | ||
curl -sSL https://pdm-project.org/install-pdm.py | ${{ env.FREEBSD_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 @@ | ||
# py311-sqlite3 is needed for coverage.py | ||
FREEBSD_PORTS_FOR_PYTHON=python311 py311-sqlite3 | ||
FREEBSD_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,7 @@ | ||
# This file is loaded in runner environment by: | ||
# - setup-tox | ||
# - freebsd-vm | ||
|
||
PDM_VERSION=2.20.1 | ||
PDM_CHECK_UPDATE=False | ||
WORKFLOW_CACHE_KEY_FILE=.github/.workflow.cache.key |
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
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
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