msys2 / setup-msys2

GitHub Action to setup MSYS2
https://github.com/marketplace/actions/setup-msys2
MIT License
302 stars 40 forks source link

Support extracting from a tarball/artifact/URL #190

Open umarcor opened 2 years ago

umarcor commented 2 years ago

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.

Biswa96 commented 2 years ago

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

umarcor commented 2 years ago

@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