Skip to content

ci: Rework ARC name generation #1

ci: Rework ARC name generation

ci: Rework ARC name generation #1

Workflow file for this run

name: Test Build
on:
workflow_call:
inputs:
runner:
type: string
default: '["gcc", "lite", "2204"]'
runner-archs:
type: string
default: '["amd64", "aarch64", "armv7l"]'
options:
type: string
default: 'auto_features=enabled'
valgrind:
type: boolean
default: true
plugin:
type: string
default: ''
secrets:
GIT_CLONE_PAT:
required: false
AWS_ACCESS_KEY:
required: false
AWS_SECRET_ACCESS_KEY:
required: false
jobs:
test_build:
name: Test Build
#runs-on: ${{ matrix.group }} #] #, "${{ fromJSON(inputs.runner) }}"]
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.arch.runner) }}
strategy:
matrix:
#archconfig: ["${{ fromJSON(inputs.runner-archs) }}"]
#group: ${{ fromJson(needs.generate-matrix.outputs.runner_group) }}
#group: ${{ fromJson(inputs.runner-archs) | map(if . == 'x86_64' then 'gcc-lite-2204-amd64' else 'gcc-lite-2204-' + . end) }}
#group: ${{ fromJson(github.event.inputs.runner-archs) | map( 'gcc-lite-2204-' + (replace(., 'x86_64', 'amd64')) ) | join(',') }}
#arch: [ {ci: x86_64, runner: amd64}, {ci: aarch64, runner: arm64}, {ci: armv7l, runner: armv7l} ]
arch: ["${{ fromJSON(inputs.runner-archs) }}" ]
build_type: [debug, release]
fail-fast: false
env:
ARCH: ${{ fromJson(
'{
"amd64": "x86_64",

Check failure on line 49 in .github/workflows/test-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-build.yml

Invalid workflow file

You have an error in your yaml syntax on line 49
"aarch64": "aarch64",
"armv7l": "armv7l"
}')[matrix.arch] }}
CC: gcc-12
CXX: g++-12
steps:
- name: Checkout .github directory
uses: actions/checkout@v4
with:
sparse-checkout: .github
repository: ${{ (inputs.plugin != '' && 'nubificus/vaccel') || '' }}
ref: ${{ (inputs.plugin != '' && 'main') || '' }}
- name: Extract arch
run: |
arch_env=$(echo "${{ matrix.group }}" | sed 's/.*-//')
echo "ARCH=$arch_env" >> "$GITHUB_ENV"
- name: Initialize workspace
id: initialize_workspace
uses: ./.github/actions/initialize-workspace
with:
remote-actions-repo: ${{ (inputs.plugin != '' && 'nubificus/vaccel') || '' }}
token: ${{ secrets.GIT_CLONE_PAT || github.token }}
- name: Download artifacts from s3
if: ${{ inputs.plugin != '' }}
uses: ./.github/actions/download-from-s3
with:
branch: ${{ steps.initialize_workspace.outputs.remote-branch }}
build-type: ${{matrix.build_type}}
arch: ${{env.ARCH}}
access-key: ${{ secrets.AWS_ACCESS_KEY }}
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
output-dir: ./artifacts/downloads/${{env.ARCH}}/${{matrix.build_type}}
install: 'true'
- name: Build project
uses: ./.github/actions/build
with:
prefix: ${{github.workspace}}/artifacts/${{env.ARCH}}/${{matrix.build_type}}/opt
build-dir: build_${{matrix.build_type}}
build-type: ${{matrix.build_type}}
options: ${{ inputs.options }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
valgrind: ${{ inputs.valgrind }}
build-dir: build_${{matrix.build_type}}
- name: Clean-up
if: ${{ always() }}
run: |
sudo rm -rf artifacts build_${{ matrix.build_type }}
[ -n "$(dpkg -l vaccel 2> /dev/null)" ] && \
sudo apt-get purge -y vaccel || echo
shell: bash