Merge remote-tracking branch 'origin/github-actions' into requests-and-ci

* origin/github-actions:
  try installing for fun
  test
  try archiving
  fix PATH
  fix PYTHONPATH
  typo
  tweaks
  update requirements to a pyinstaller that works with python2
  run pyinstaller
  python 2?
  which python
  hacking
  do we have pyenv
  hacking
  does python version switching work?
  fix bash?
  wip
  wip on windows CI
  GitHub Actions
This commit is contained in:
Timothy Sutton 2022-11-09 15:21:00 -05:00
commit 5116b6aa91
4 changed files with 68 additions and 0 deletions

39
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
# push:
# branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-2019
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Build
run: bash .\ci\windows\ci-windows.sh
- name: Archive
uses: actions/upload-artifact@v3
with:
name: brigadier-windows-exe
path: D:\a\brigadier\brigadier\dist
- name: Test
run: bash .\ci\windows\test.sh

21
ci/windows/ci-windows.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
set -eux -o pipefail
PYTHON_VERSION=2.7.18
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd )"
python="/c/hostedtoolcache/windows/Python/${PYTHON_VERSION}/x64/python"
export PYTHONPATH="${python}"
$python -V
$python -m pip install -r "${script_dir}/requirements.txt"
$python -m pip freeze
# pip-installed exes will be installed here, so we'll put those at the front
# of the PATH
PATH="/c/hostedtoolcache/windows/Python/${PYTHON_VERSION}/x64/Scripts:$PATH"
pyinstaller \
--onefile \
brigadier

View file

@ -0,0 +1 @@
pyinstaller==3.6

7
ci/windows/test.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -eux -o pipefail
whoami
/d/a/brigadier/brigadier/dist/brigadier -m Macmini4,1 -i