Switch to github actions for test workflow

master
Ryan Caezar Itang 2022-08-28 13:38:14 +08:00 committed by Hugo Locurcio
parent c12118512a
commit 1153f8a5e4
3 changed files with 48 additions and 70 deletions

View File

@ -1,25 +0,0 @@
# Copyright © 2018-2020 Hugo Locurcio and contributors - CC0 1.0 Universal
# See `LICENSE.md` included in the source distribution for details.
jobs:
# Installs and uninstalls every package in the bucket
# This is done to ensure URLs used in manifests are still functional
- job: test
condition: >-
or(
eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')
)
pool:
vmImage: vs2017-win2016
steps:
- powershell: |
# Install Scoop
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
scoop bucket add extras
# Install packages
Get-ChildItem "./bucket/*.json" | Foreach-Object {
scoop install "./bucket/$($_.BaseName).json"
scoop uninstall "$($_.BaseName)"
}

48
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
test_powershell:
name: WindowsPowerShell
runs-on: windows-latest
steps:
- name: Checkout Bucket
uses: actions/checkout@v2
with:
fetch-depth: 2
path: 'my_bucket'
- name: Checkout Scoop
uses: actions/checkout@v2
with:
repository: ScoopInstaller/Scoop
path: 'scoop_core'
- name: Init and Test
shell: powershell
run: |
$env:SCOOP_HOME="$(Convert-Path '.\scoop_core')"
.\scoop_core\test\bin\init.ps1
.\my_bucket\bin\test.ps1
test_pwsh:
name: PowerShell
runs-on: windows-latest
steps:
- name: Checkout Bucket
uses: actions/checkout@v2
with:
fetch-depth: 2
path: 'my_bucket'
- name: Checkout Scoop
uses: actions/checkout@v2
with:
repository: ScoopInstaller/Scoop
path: 'scoop_core'
- name: Init and Test
shell: pwsh
run: |
$env:SCOOP_HOME="$(Convert-Path '.\scoop_core')"
.\scoop_core\test\bin\init.ps1
.\my_bucket\bin\test.ps1

View File

@ -1,45 +0,0 @@
version: "{build}-{branch}"
branches:
except:
- gh-pages
build: off
deploy: off
clone_depth: 2
image: Visual Studio 2022
environment:
scoop: C:\projects\scoop
scoop_home: C:\projects\scoop
scoop_helpers: C:\projects\helpers
lessmsi: '%scoop_helpers%\lessmsi\lessmsi.exe'
innounp: '%scoop_helpers%\innounp\innounp.exe'
matrix:
# - PowerShell: 5
- PowerShell: 7
cache:
- '%USERPROFILE%\Documents\WindowsPowerShell\Modules -> appveyor.yml'
- C:\projects\helpers -> appveyor.yml, test\bin\*.ps1
matrix:
fast_finish: true
init:
- ps: if(!(Test-Path "$env:SCOOP")) { git clone -q --depth=1 "https://github.com/ScoopInstaller/Scoop" "$env:SCOOP" }
for:
# - matrix:
# only:
# - PowerShell: 5
# install:
# - ps: . "$env:SCOOP_HOME\test\bin\init.ps1"
# test_script:
# - ps: . "$env:SCOOP_HOME\test\bin\test.ps1" -TestPath "$env:APPVEYOR_BUILD_FOLDER"
- matrix:
only:
- PowerShell: 7
install:
- pwsh: . "$env:SCOOP_HOME\test\bin\init.ps1"
test_script:
- pwsh: . "$env:SCOOP_HOME\test\bin\test.ps1" -TestPath "$env:APPVEYOR_BUILD_FOLDER"