From cc0b85a77391749a48172f37324b699297b3bd3f Mon Sep 17 00:00:00 2001 From: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> Date: Wed, 9 Mar 2022 13:39:58 +0530 Subject: [PATCH] (chore): Migrate CI to GitHub Actions (#4) * Delete appveyor.yml * Create ci.yml * Update test.ps1 * Update README.md --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ README.md | 3 +-- appveyor.yml | 39 -------------------------------- bin/test.ps1 | 3 ++- 4 files changed, 51 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f31872f --- /dev/null +++ b/.github/workflows/ci.yml @@ -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="$(Resolve-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="$(Resolve-Path '.\scoop_core')" + .\scoop_core\test\bin\init.ps1 + .\my_bucket\bin\test.ps1 diff --git a/README.md b/README.md index 099a820..9d53217 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Scoop Bucket Template - + Template bucket for [Scoop](https://scoop.sh), the Windows command-line installer. @@ -21,4 +21,3 @@ To make a new manifest contribution, please read the [Contributing Guide](https: - Modify the Readme.md and the bin/auto-pr.ps1 files accordingly. - Enable GitHub Actions for this repository. -- Login to AppVeyor and import this repository. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 69efdaf..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: "{build}-{branch}" -branches: - except: - - gh-pages -build: off -deploy: off -clone_depth: 2 -image: Visual Studio 2019 -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: Current -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: Current - install: - - pwsh: . "$env:SCOOP_HOME\test\bin\init.ps1" - test_script: - - pwsh: . "$env:SCOOP_HOME\test\bin\test.ps1" -TestPath "$env:APPVEYOR_BUILD_FOLDER" diff --git a/bin/test.ps1 b/bin/test.ps1 index 183d464..2bf264c 100644 --- a/bin/test.ps1 +++ b/bin/test.ps1 @@ -1,2 +1,3 @@ if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } -Invoke-Pester "$psscriptroot/.." +$result = Invoke-Pester "$psscriptroot/.." -PassThru +exit $result.FailedCount