Gource #335
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
# Authors: | |
# Unai Martinez-Corral | |
# | |
# Copyright 2021-2022 Unai Martinez-Corral <unai.martinezcorral@ehu.eus> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Gource | |
on: | |
push: | |
paths: | |
- '.github/workflows/Gource.yml' | |
- 'gource/**' | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
Params: | |
runs-on: ubuntu-latest | |
outputs: | |
cfg: ${{ steps.params.outputs.cfg }} | |
jobs: ${{ steps.params.outputs.jobs }} | |
mailmap: ${{ steps.params.outputs.mailmap }} | |
steps: | |
- name: '🧰 Checkout' | |
uses: actions/checkout@v3 | |
- name: Convert YAML config to JSON string | |
id: params | |
shell: python | |
run: | | |
from pathlib import Path | |
from subprocess import check_call | |
import yaml | |
ROOT = Path('gource').resolve() | |
LogDir = ROOT / 'logs' | |
LogDir.mkdir(exist_ok=True) | |
# TODO Append to the enabled list, when the workflow is triggered by an scheduled event | |
scheduled_only = [ | |
'Hitchhiker', | |
'iverilog', | |
'MSYS2', | |
'MSYS2-all', | |
'CHIPSAlliance', | |
'LiteX', | |
'FPGAwars' | |
] | |
enabled = [ | |
'EDAA', | |
'EDAA-Workflows', | |
'EDAA-Utilities', | |
'pyTooling', | |
'ghdl', | |
'verilator', | |
'osvvm', | |
'osvb', | |
'osvb-noroot', | |
'HDL', | |
'DBHI', | |
'VUnit', | |
'HDLC', | |
'NEORV32', | |
'CoCoTb', | |
'openFPGALoader', | |
'renode', | |
'spf13', | |
'f4pga-core', | |
'F4PGA', | |
'VTR', | |
'YosysHQ', | |
'LibreCores', | |
] | |
with (ROOT / 'config.yml').open('r') as fptr: | |
cfg = yaml.load(fptr, Loader=yaml.FullLoader) | |
for key in cfg: | |
cfg[key]['name'] = key | |
print(f"::set-output name=cfg::{cfg!s}") | |
jobs = [ | |
{'name': key, 'title': job['title']} | |
for key, job in cfg.items() | |
if key in enabled | |
] | |
print(f"::set-output name=jobs::{jobs!s}") | |
with (ROOT / '.mailmap').open('r') as fptr: | |
print(f"::set-output name=mailmap::{','.join(fptr.read().splitlines())!s}") | |
GetLogs: | |
needs: Params | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get logs | |
uses: umarcor/umarcor/gource/logs@main | |
with: | |
cfg: ${{ needs.Params.outputs.cfg }} | |
mailmap: ${{ needs.Params.outputs.mailmap }} | |
artifact: glogs | |
GenerateVideo: | |
needs: | |
- Params | |
- GetLogs | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJson(needs.Params.outputs.jobs) }} | |
name: ${{ matrix.name }} | ${{ matrix.title }} | |
steps: | |
- name: Get job from config | |
shell: python | |
id: job | |
run: | | |
job = ${{ needs.Params.outputs.cfg }}['${{ matrix.name }}'] | |
print(f"::set-output name=job::{job!s}") | |
- name: Combine logs and generate video | |
uses: umarcor/umarcor/gource/video@main | |
with: | |
artifact: glogs | |
job: ${{ steps.job.outputs.job }} | |
Release: | |
needs: GenerateVideo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
path: artifact | |
- run: | | |
cd artifact | |
tar czvf glogs.tar.gz glogs | |
rm -rf glogs | |
- uses: pyTooling/Actions/releaser@r0 | |
with: | |
token: ${{ github.token }} | |
files: artifact/**/* | |
tag: gource-videos |