Runner CI #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Runner CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- releases/* | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
runtime: [ linux-x64, linux-arm64, linux-arm, linux-s390x, win-x64, win-arm64, osx-x64, osx-arm64 ] | |
include: | |
- runtime: linux-x64 | |
os: ubuntu-latest | |
devScript: ./dev.sh | |
- runtime: linux-arm64 | |
os: ubuntu-latest | |
devScript: ./dev.sh | |
- runtime: linux-arm | |
os: ubuntu-latest | |
devScript: ./dev.sh | |
- runtime: linux-s390x | |
os: ubuntu-latest | |
devScript: ./dev.sh | |
- runtime: osx-x64 | |
os: macOS-latest | |
devScript: ./dev.sh | |
- runtime: osx-arm64 | |
os: macOS-latest | |
devScript: ./dev.sh | |
- runtime: win-x64 | |
os: windows-2019 | |
devScript: ./dev | |
- runtime: win-arm64 | |
os: windows-latest | |
devScript: ./dev | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get runner version | |
id: runnerInfo | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const fs = require('fs'); | |
const runnerVersion = fs.readFileSync('src/runnerversion', 'utf8').replace(/\n$/g, '') | |
core.setOutput('version', runnerVersion); | |
core.setOutput('package_name', `actions-runner-${{ matrix.runtime }}-${runnerVersion}${{ startsWith(matrix.runtime, 'win') && '.zip' || '.tar.gz' }}`); | |
# Build runner layout | |
- name: Build & Layout Release | |
run: | | |
${{ matrix.devScript }} layout Release ${{ matrix.runtime }} | |
working-directory: src | |
# Run tests | |
- name: L0 | |
run: | | |
${{ matrix.devScript }} test | |
working-directory: src | |
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'linux-s390x' && matrix.runtime != 'osx-arm64' && matrix.runtime != 'win-arm64' | |
# Create runner package tar.gz/zip | |
- name: Package Release | |
if: github.event_name != 'pull_request' | |
run: | | |
${{ matrix.devScript }} package Release ${{ matrix.runtime }} | |
working-directory: src | |
# Upload runner package tar.gz/zip as artifact | |
- name: Publish Artifact | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: runner-package-${{ matrix.runtime }} | |
path: _package/${{ steps.runnerInfo.outputs.package_name }} |