Skip to content

impl

impl #890

Workflow file for this run

# Authors:
# Sebastian Birke
# <git@se-bi.de>
# Unai Martinez-Corral
# <umartinezcorral@antmicro.com>
# <unai.martinezcorral@ehu.eus>
#
# Copyright Unai Martinez-Corral
#
# 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: 'impl'
on:
pull_request:
push:
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:
repository_dispatch:
types: [ impl ]
env:
DOCKER_BUILDKIT: 1
jobs:
# TODO: Handle 'pull' in 'config.yml' (and command 'jobs').
# TODO: Support 'skip-test' in the reusable workflow 'common.yml'.
# Then, use the reusable workflow 'common.py' here.
matrix:
runs-on: ubuntu-latest
outputs:
impl-build: ${{ steps.impl-build.outputs.matrix }}
# TODO: Handle 'pull' in 'config.yml' (and command 'jobs').
#impl-prjs: ${{ steps.impl-prjs.outputs.matrix }}
impl: ${{ steps.impl.outputs.matrix }}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
- name: 🛠️ Setup
run: ./utils/setup.sh
- name: 🔧 Generate build matrix
id: impl-build
run: pyHDLC jobs impl-build
#- name: 🔧 Generate prjs matrix
# id: impl-prjs
# run: pyHDLC jobs impl-prjs
- name: 🔧 Generate matrix
id: impl
run: pyHDLC jobs impl
impl-build:
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.impl-build) }}
name: impl-build ${{ matrix.arch }}/${{ matrix.os }} | ${{ matrix.imgs }}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: 🚧 Build, test and release
uses: ./utils/build-test-release
with:
gcr_token: '${{ secrets.GCR_JSON_KEY }}'
gh_token: '${{ github.token }}'
docker_user: '${{ secrets.DOCKER_USER }}'
docker_pass: '${{ secrets.DOCKER_PASS }}'
skip-release: ${{ github.event_name == 'pull_request' }}
skip-test: True
architecture: ${{ matrix.arch }}
collection: ${{ matrix.os }}
images: ${{ matrix.imgs }}
pull: >-
ghdl/yosys
pkg/ghdl-yosys-plugin
pkg/yosys
impl-prjs:
needs: [ impl-build ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sys:
# Debian Bullseye
- { os: debian/bullseye, arch: amd64 }
task:
- { arch: ice40, prj: icestorm }
- { arch: ecp5, prj: prjtrellis }
- { arch: nexus, prj: prjoxide }
name: '[${{ matrix.sys.os }}|${{ matrix.sys.arch }}] impl · ${{ matrix.task.arch }} ${{ matrix.task.prj }}'
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: 🛠️ Setup
run: ./utils/setup.sh ${{ matrix.sys.arch }}
# TODO: Action 'build-test-release' cannot be used here yet, because 'task.arch' and 'task.prj' are not provided by
# 'pyHDLC jobs'. Hence, 'config.yml' needs to be extended in order to handle generation of 'pull' image lists.
- name: 🚧 Build
run: >-
pyHDLC pull -a ${{ matrix.sys.arch }} -c ${{ matrix.sys.os }}
build/impl
pkg/nextpnr/${{ matrix.task.arch }}
pkg/${{ matrix.task.prj }}
- name: 🚦 Test
run: >-
pyHDLC build -q -a ${{ matrix.sys.arch }} -c ${{ matrix.sys.os }} -d
impl/${{ matrix.task.arch }}
impl/${{ matrix.task.prj }}
- name: 🛰️ Release
if: github.event_name != 'pull_request'
uses: pyTooling/Actions/with-post-step@r0
with:
main: |
echo '${{ secrets.GCR_JSON_KEY }}' | docker login gcr.io -u _json_key --password-stdin
echo '${{ github.token }}' | docker login ghcr.io -u gha --password-stdin
echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin
dockerRelease ${{ matrix.sys.arch }} ${{ matrix.sys.os }} \
impl/${{ matrix.task.arch }} \
impl/${{ matrix.task.prj }}
post: for registry in gcr.io ghcr.io docker.io; do docker logout "$registry"; done
impl:
needs: [ matrix, impl-build, impl-prjs ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.impl) }}
name: impl ${{ matrix.arch }}/${{ matrix.os }} | ${{ matrix.imgs }}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: 🚧 Build, test and release
uses: ./utils/build-test-release
with:
gcr_token: '${{ secrets.GCR_JSON_KEY }}'
gh_token: '${{ github.token }}'
docker_user: '${{ secrets.DOCKER_USER }}'
docker_pass: '${{ secrets.DOCKER_PASS }}'
skip-release: ${{ github.event_name == 'pull_request' }}
architecture: ${{ matrix.arch }}
collection: ${{ matrix.os }}
images: ${{ matrix.imgs }}
pull: >-
build/impl
pkg/nextpnr/ice40
pkg/nextpnr/ecp5
pkg/nextpnr/nexus
pkg/nextpnr/generic
pkg/icestorm
pkg/prjtrellis
pkg/prjoxide