mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-20 14:11:37 +00:00
136 lines
3.7 KiB
YAML
136 lines
3.7 KiB
YAML
name: Build and test GAM
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
schedule:
|
|
- cron: '37 22 * * *'
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
env:
|
|
BUILD_PYTHON_VERSION: "3.9.0"
|
|
MIN_PYTHON_VERSION: "3.9.0"
|
|
BUILD_OPENSSL_VERSION: "1.1.1h"
|
|
MIN_OPENSSL_VERSION: "1.1.1h"
|
|
PATCHELF_VERSION: "0.11"
|
|
PYINSTALLER_COMMIT: "5bc2c4620bfc5dde5a76a007c7ff50ee74223ca5"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-16.04
|
|
jid: 1
|
|
goal: "build"
|
|
- os: ubuntu-18.04
|
|
jid: 2
|
|
goal: "build"
|
|
- os: ubuntu-20.04
|
|
jid: 3
|
|
goal: "build"
|
|
- os: macos-10.15
|
|
jid: 4
|
|
goal: "build"
|
|
- os: windows-2019
|
|
jid: 5
|
|
goal: "build"
|
|
PLATFORM: "x86_64"
|
|
- os: windows-2019
|
|
jid: 6
|
|
goal: "build"
|
|
PLATFORM: "x86"
|
|
- os: ubuntu-20.04
|
|
goal: "test"
|
|
python: "3.6"
|
|
jid: 7
|
|
- os: ubuntu-20.04
|
|
goal: "test"
|
|
python: "3.7"
|
|
jid: 8
|
|
- os: ubuntu-20.04
|
|
goal: "test"
|
|
python: "3.8"
|
|
jid: 9
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
|
|
- name: Cache multiple paths
|
|
uses: actions/cache@v2
|
|
if: matrix.goal != 'test'
|
|
with:
|
|
path: |
|
|
~/python
|
|
~/ssl
|
|
key: ${{ matrix.os }}-${ matrix.jid }}
|
|
|
|
- name: Build and install Python/OpenSSL
|
|
if: steps.cache-primes.outputs.cache-hit != 'true'
|
|
run: |
|
|
set +e
|
|
if [ "${RUNNER_OS}" == "macOS" ]; then
|
|
export GAMOS="macos"
|
|
else
|
|
export GAMOS=$"${RUNNER_OS,,}"
|
|
fi
|
|
if [ "${ImageOS}" == "win16" ]; then
|
|
export PLATFORM="x86";
|
|
else
|
|
export PLATFORM="x86_64"
|
|
fi
|
|
echo "GAMOS=${GAMOS}" >> $GITHUB_ENV
|
|
echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV
|
|
cd src
|
|
source travis/${GAMOS}-before-install.sh
|
|
echo "python=$python" >> $GITHUB_ENV
|
|
echo "pip=$pip" >> $GITHUB_ENV
|
|
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
|
|
- name: Build GAM
|
|
run: |
|
|
set +e
|
|
cd src
|
|
source travis/${GAMOS}-install.sh
|
|
echo "gampath=$gampath" >> $GITHUB_ENV
|
|
echo "gam=$gam" >> $GITHUB_ENV
|
|
|
|
- name: Basic Tests - all jobs
|
|
run: |
|
|
set +e
|
|
cd src
|
|
$python -m unittest discover --start-directory ./ --pattern "*_test.py" --buffer
|
|
touch $gampath/nobrowser.txt
|
|
$gam version extended
|
|
$gam version | grep runner # runner should be part of the path (not /tmp or such)
|
|
|
|
- name: Basic Tests - build jobs only
|
|
run: |
|
|
cd src
|
|
# Check Python version
|
|
vline=$($gam version | grep "Python ")
|
|
python_line=($vline)
|
|
this_python=${python_line[1]}
|
|
$python tools/a_atleast_b.py $this_python $MIN_PYTHON_VERSION
|
|
# Check OpenSSL version
|
|
vline=$($gam version extended | grep "OpenSSL ")
|
|
openssl_line=($vline)
|
|
this_openssl="${openssl_line[1]}"
|
|
$python tools/a_atleast_b.py "${this_openssl}" "${MIN_OPENSSL_VERSION}"
|
|
|
|
- name: Live API tests - build jobs only
|
|
run: |
|
|
bash .github/actions/decrypt.sh
|
|
cd src
|
|
$gam oauth info
|
|
$gam info user
|
|
$gam
|