setup-msys2 icon indicating copy to clipboard operation
setup-msys2 copied to clipboard

Support extracting from a tarball/artifact/URL

Open umarcor opened this issue 3 years ago • 2 comments

It would be interesting for setup-msys2 to support a third source type. Apart from the built-in installation or a clean release, it would be convenient if users could provide their own tarball/artifact. That would allow to use one job in the workflow for setup (installing/updating the dependencies) and then reuse it in multiple parallel jobs. Currently, using setup-msys2 in parallel does update multiple packages redundantly.

umarcor avatar Jan 09 '22 05:01 umarcor

It may be easier to understand with an example. Like, pacman -U command accepts URL or path of a package.

Biswa96 avatar Jan 09 '22 05:01 Biswa96

@Biswa96 the point is to avoid downloading and extracting/installing the same packages multiple times in parallel. See, for example: https://github.com/umarcor/neorv32-setups/actions/runs/1673157184

A MWE of the proposal would be:

name: Test

on:
 push:
 pull_request:
 schedule:
   - cron: '0 0 * * 3,6'

jobs:


 setup:
   runs-on: windows-latest
   steps:

   - uses: msys2/setup-msys2@v2
     with:
       update: true
       install: >-
         base-devel
         git
       pacboy: >-
         icestorm:p
         yosys:p
         nextpnr:p

   - name: '📤 Upload MSYS2 installation'
     uses: actions/upload-artifact@v2
     with:
       path: location_of_msys2???

 run:
   needs: setup
   runs-on: windows-latest
   strategy:
     fail-fast: false
     matrix:
       include:
         - acase
         - anothercase
         - athirdcase
         - ...
   defaults:
     run:
       shell: msys2 {0}
   steps:

   - uses: msys2/setup-msys2@v2
     with:
       update: false
       release: artifact???

   - run: uname -a

umarcor avatar Jan 09 '22 06:01 umarcor