cross-platform-actions / action

Cross-platform GitHub action
MIT License
128 stars 19 forks source link

Use different syntax for multiple steps feature #83

Open Xottab-DUTY opened 7 months ago

Xottab-DUTY commented 7 months ago

Create a set of shell files during first action run and then use them:

    steps:
    - name: Setup VM and cpa.sh, sync_files_cpa.sh and shutdown_cpa_vm.sh
      uses: cross-platform-actions/action@v0.22.0
      with:
        operating_system: freebsd
        architecture: x86_64
        version: 13.2
        cpu_count: 4
        memory: 8G
        # shutdown_vm: false # option removed, will be shutdown during post action
        sync_files: runner-to-vm # syncing back from VM to runner via vm-to-runner is no longer applicable
        shell: cpa.sh # allow to select custom name for shell file

    - run: sudo pkg update
      shell: cpa.sh {0}

    - run: sudo pkg install -y cmake
      shell: cpa.sh {0}

    # manual sync
    - run: sync_files_cpa.sh vm-to-runner

    # VM will be shutdown automatically in the end of a run (via post job),
    # but it can be disabled manually to free the resources for possible next steps
    - run: shutdown_cpa_vm.sh

Inspired by https://github.com/jirutka/setup-alpine

The motivation is to allow using same steps within a big matrix of jobs across multiple platforms.

jacob-carlborg commented 7 months ago

Interesting, I didn't know this was possible.