mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
ci: Fix multi-arch builds
- Introduce separate os/arch to the matrix - Pass os/arch to the local build - Switch to upload-artifact@v0 and cache@v2 - Fetch linuxkit binary from artefacts rather than using cache - Add some debug (print file and hashes) While at it, add some debug for the generated artefacts. fixes https://github.com/linuxkit/linuxkit/issues/3522 Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
This commit is contained in:
parent
e02ccb6008
commit
ffe5dedb0a
136
.github/workflows/ci.yml
vendored
136
.github/workflows/ci.yml
vendored
@ -6,12 +6,22 @@ jobs:
|
||||
name: Build & Test
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- amd64-linux
|
||||
- arm64-linux
|
||||
- s390x-linux
|
||||
- amd64-darwin
|
||||
- amd64-windows.exe
|
||||
target:
|
||||
- os: linux
|
||||
arch: amd64
|
||||
suffix: amd64-linux
|
||||
- os: linux
|
||||
arch: arm64
|
||||
suffix: arm64-linux
|
||||
- os: linux
|
||||
arch: s390x
|
||||
suffix: s390x-linux
|
||||
- os: darwin
|
||||
arch: amd64
|
||||
suffix: amd64-darwin
|
||||
- os: windows
|
||||
arch: amd64
|
||||
suffix: amd64-windows.exe
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -47,29 +57,29 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make LOCAL_TARGET=bin/linuxkit-${{matrix.arch}} local-build
|
||||
make GOARCH=${{matrix.target.arch}} GOOS=${{matrix.target.os}} LOCAL_TARGET=bin/linuxkit-${{matrix.target.suffix}} local-build
|
||||
file bin/linuxkit-${{matrix.target.suffix}}
|
||||
env:
|
||||
GOPATH: ${{runner.workspace}}
|
||||
|
||||
- name: Checksum
|
||||
run: cd bin && sha256sum linuxkit-${{matrix.arch}} > linuxkit-${{matrix.arch}}.SHA256SUM
|
||||
run: |
|
||||
cd bin && sha256sum linuxkit-${{matrix.target.suffix}} > linuxkit-${{matrix.target.suffix}}.SHA256SUM
|
||||
cat linuxkit-${{matrix.target.suffix}}.SHA256SUM
|
||||
|
||||
- name: Test
|
||||
run: make local-test
|
||||
env:
|
||||
GOPATH: ${{runner.workspace}}
|
||||
|
||||
- name: Cache binary
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: bin
|
||||
key: linuxkit-${{matrix.arch}}-${{hashFiles('src/**')}}
|
||||
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@v1.0.0
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: linuxkit-${{matrix.arch}}
|
||||
path: bin
|
||||
name: linuxkit-${{matrix.target.suffix}}
|
||||
path: |
|
||||
bin/linuxkit-${{matrix.target.suffix}}
|
||||
bin/linuxkit-${{matrix.target.suffix}}.SHA256SUM
|
||||
if-no-files-found: error
|
||||
|
||||
build_packages:
|
||||
name: Build Packages
|
||||
@ -81,15 +91,17 @@ jobs:
|
||||
with:
|
||||
path: ./src/github.com/linuxkit/linuxkit
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Build Packages
|
||||
run: |
|
||||
@ -113,7 +125,7 @@ jobs:
|
||||
|
||||
- name: Restore RTF From Cache
|
||||
id: cache-rtf
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: bin
|
||||
key: rtf-${{hashFiles('Makefile')}}
|
||||
@ -124,17 +136,19 @@ jobs:
|
||||
|
||||
- name: Symlink RTF
|
||||
run: |
|
||||
sudo ln -s `pwd`/bin/rtf /usr/local/bin/rtf
|
||||
sudo ln -s $(pwd)/bin/rtf /usr/local/bin/rtf
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
@ -159,7 +173,7 @@ jobs:
|
||||
|
||||
- name: Restore RTF From Cache
|
||||
id: cache-rtf
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: bin
|
||||
key: rtf-${{hashFiles('Makefile')}}
|
||||
@ -170,17 +184,19 @@ jobs:
|
||||
|
||||
- name: Symlink RTF
|
||||
run: |
|
||||
sudo ln -s `pwd`/bin/rtf /usr/local/bin/rtf
|
||||
sudo ln -s $(pwd)/bin/rtf /usr/local/bin/rtf
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
@ -205,7 +221,7 @@ jobs:
|
||||
|
||||
- name: Restore RTF From Cache
|
||||
id: cache-rtf
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: bin
|
||||
key: rtf-${{hashFiles('Makefile')}}
|
||||
@ -216,17 +232,19 @@ jobs:
|
||||
|
||||
- name: Symlink RTF
|
||||
run: |
|
||||
sudo ln -s `pwd`/bin/rtf /usr/local/bin/rtf
|
||||
sudo ln -s $(pwd)/bin/rtf /usr/local/bin/rtf
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
@ -251,7 +269,7 @@ jobs:
|
||||
|
||||
- name: Restore RTF From Cache
|
||||
id: cache-rtf
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: bin
|
||||
key: rtf-${{hashFiles('Makefile')}}
|
||||
@ -262,17 +280,19 @@ jobs:
|
||||
|
||||
- name: Symlink RTF
|
||||
run: |
|
||||
sudo ln -s `pwd`/bin/rtf /usr/local/bin/rtf
|
||||
sudo ln -s $(pwd)/bin/rtf /usr/local/bin/rtf
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
@ -297,7 +317,7 @@ jobs:
|
||||
|
||||
- name: Restore RTF From Cache
|
||||
id: cache-rtf
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: bin
|
||||
key: rtf-${{hashFiles('Makefile')}}
|
||||
@ -308,17 +328,19 @@ jobs:
|
||||
|
||||
- name: Symlink RTF
|
||||
run: |
|
||||
sudo ln -s `pwd`/bin/rtf /usr/local/bin/rtf
|
||||
sudo ln -s $(pwd)/bin/rtf /usr/local/bin/rtf
|
||||
|
||||
- name: Restore LinuxKit From Cache
|
||||
uses: actions/cache@v1
|
||||
- name: Download linuxkit
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: lkt
|
||||
key: linuxkit-amd64-linux-${{hashFiles('src/**')}}
|
||||
name: linuxkit-amd64-linux
|
||||
path: bin
|
||||
|
||||
- name: Symlink Linuxkit
|
||||
run: |
|
||||
sudo ln -s `pwd`/lkt/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
chmod ugo+x bin/linuxkit-amd64-linux
|
||||
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
|
||||
/usr/local/bin/linuxkit version
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
|
Loading…
Reference in New Issue
Block a user