diff --git a/.github/workflows/nextpnr.yml b/.github/workflows/nextpnr.yml index 1fa570d0..c669617f 100644 --- a/.github/workflows/nextpnr.yml +++ b/.github/workflows/nextpnr.yml @@ -1,4 +1,5 @@ # Authors: +# Sebastian Birke # Unai Martinez-Corral # # Copyright 2019-2021 Unai Martinez-Corral @@ -43,16 +44,24 @@ jobs: - run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH - - run: dockerBuild nextpnr:ice40 nextpnr ice40 - - run: dockerBuild nextpnr:icestorm nextpnr icestorm - - run: dockerBuild nextpnr:ecp5 nextpnr ecp5 - - run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis - - run: dockerBuild nextpnr nextpnr + - run: dockerBuild pkg:nextpnr-ice40 nextpnr pkg-ice40 + - run: dockerBuild nextpnr:ice40 nextpnr ice40 + - run: dockerBuild nextpnr:icestorm nextpnr icestorm + - run: dockerBuild pkg:nextpnr-ecp5 nextpnr pkg-ecp5 + - run: dockerBuild nextpnr:ecp5 nextpnr ecp5 + - run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis + - run: dockerBuild pkg:nextpnr-generic nextpnr pkg-generic + - run: dockerBuild nextpnr:generic nextpnr generic + - run: dockerBuild nextpnr nextpnr + - run: dockerTestPkg nextpnr-ice40 - run: dockerTest nextpnr:ice40 - run: dockerTest nextpnr:icestorm + - run: dockerTestPkg nextpnr-ecp5 - run: dockerTest nextpnr:ecp5 - run: dockerTest nextpnr:prjtrellis + - run: dockerTestPkg nextpnr-generic + - run: dockerTest nextpnr:generic - run: dockerTest nextpnr - name: Login to DockerHub @@ -62,17 +71,29 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} + - run: dockerPush pkg:nextpnr-ice40 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr:ice40 if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' - run: dockerPush nextpnr:icestorm if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush pkg:nextpnr-ecp5 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr:ecp5 if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' - run: dockerPush nextpnr:prjtrellis if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush pkg:nextpnr-generic + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush nextpnr:generic + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' diff --git a/nextpnr.dockerfile b/nextpnr.dockerfile index 9f2e67ab..8b2c6886 100644 --- a/nextpnr.dockerfile +++ b/nextpnr.dockerfile @@ -67,6 +67,11 @@ COPY --from=hdlc/pkg:icestorm /icestorm / #--- +FROM scratch AS pkg-ice40 +COPY --from=build-ice40 /opt/nextpnr /nextpnr-ice40 + +#--- + FROM build AS build-ecp5 COPY --from=hdlc/pkg:prjtrellis /prjtrellis / @@ -91,12 +96,17 @@ COPY --from=hdlc/pkg:prjtrellis /prjtrellis / #--- -FROM build-ice40 AS build-all +FROM scratch AS pkg-ecp5 +COPY --from=build-ecp5 /opt/nextpnr /nextpnr-ecp5 + +#--- + +FROM build-ice40 AS build-generic COPY --from=hdlc/pkg:prjtrellis /prjtrellis / RUN cd /tmp/nextpnr/build \ && cmake .. \ - -DARCH=all \ + -DARCH=generic \ -DBUILD_GUI=OFF \ -DBUILD_PYTHON=ON \ -DUSE_OPENMP=ON \ @@ -105,5 +115,17 @@ RUN cd /tmp/nextpnr/build \ #--- +FROM base AS generic +COPY --from=build-generic /opt/nextpnr / + +#--- + +FROM scratch AS pkg-generic +COPY --from=build-generic /opt/nextpnr /nextpnr-generic + +#--- + FROM base AS all -COPY --from=build-all /opt/nextpnr / +COPY --from=build-ice40 /opt/nextpnr / +COPY --from=build-ecp5 /opt/nextpnr / +COPY --from=build-generic /opt/nextpnr / diff --git a/test/nextpnr--generic.sh b/test/nextpnr--generic.sh new file mode 100644 index 00000000..31cfb187 --- /dev/null +++ b/test/nextpnr--generic.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +# Authors: +# Sebastian Birke +# Unai Martinez-Corral +# +# Copyright 2020-2021 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 + +set -e + +cd $(dirname "$0") + +./_env.sh + +./smoke-tests/nextpnr-generic.sh + +./_todo.sh diff --git a/test/nextpnr-ecp5.pkg.sh b/test/nextpnr-ecp5.pkg.sh new file mode 100755 index 00000000..9c2d0872 --- /dev/null +++ b/test/nextpnr-ecp5.pkg.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# Unai Martinez-Corral +# +# Copyright 2020-2021 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 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +file /usr/local/bin/nextpnr-ecp5 + +./_todo.sh diff --git a/test/nextpnr-generic.pkg.sh b/test/nextpnr-generic.pkg.sh new file mode 100755 index 00000000..2ead9045 --- /dev/null +++ b/test/nextpnr-generic.pkg.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# Unai Martinez-Corral +# +# Copyright 2020-2021 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 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +file /usr/local/bin/nextpnr-generic + +./_todo.sh diff --git a/test/nextpnr-ice40.pkg.sh b/test/nextpnr-ice40.pkg.sh new file mode 100755 index 00000000..d7972144 --- /dev/null +++ b/test/nextpnr-ice40.pkg.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# Unai Martinez-Corral +# +# Copyright 2020-2021 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 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +file /usr/local/bin/nextpnr-ice40 + +./_todo.sh