Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try running tests on freebsd #60

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/test-vm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: test-vm
# run tests in a VM via vagrant
# GHA doesn't support freebsd, but we can test there

on:
pull_request:
push:
branches:
- "main"

jobs:
test:
# ref: https://github.com/jonashackt/vagrant-github-actions
# MIT License
runs-on: macos-10.15

strategy:
fail-fast: true
matrix:
box:
- freebsd
steps:
- uses: actions/checkout@v2

- name: Cache Vagrant boxes
uses: actions/cache@v2
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-

- name: Show Vagrant version
run: vagrant --version

- name: Run vagrant up
run: vagrant up ${{ matrix.box }}

- name: install dependencies
run: |
vagrant ssh ${{ matrix.box }} -c "
cd /vagrant
pip install --upgrade pip
pip install --upgrade --pre -r dev-requirements.txt .
pip freeze
"

- name: Run tests
run: |
vagrant ssh ${{ matrix.box }} -c "
cd /vagrant
pytest -v --color=yes --cov=wurlitzer test.py
"

- name: Submit codecov report
run: |
vagrant ssh ${{ matrix.box }} -c "
cd /vagrant
codecov
"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@ docs/_build/
# PyBuilder
target/

#Ipython Notebook
# Notebooks
.ipynb_checkpoints

# vagrant
.vagrant
22 changes: 22 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.ssh.forward_env = [
# for codecov, from
# https://github.com/codecov/uploader/blob/b561fe71e0262aa606b7391014ff01228adfac3d/src/ci_providers/provider_githubactions.ts#L113-L124
'GITHUB_ACTION',
'GITHUB_HEAD_REF',
'GITHUB_REF',
'GITHUB_REPOSITORY',
'GITHUB_RUN_ID',
'GITHUB_SERVER_URL',
'GITHUB_SHA',
'GITHUB_WORKFLOW',
]

config.vm.define "freebsd" do |bsd|
vm = bsd.vm
vm.box = "generic/freebsd12"
vm.provision "shell", inline: "pkg install -y git py38-pip py38-sqlite3", privileged: true
vm.provision "shell", inline: "echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.bash_profile", privileged: false
end
end