ci: run version command as no command is exit code 1 #6
Workflow file for this run
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
name: cross compile dotnet app | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
build: | |
runs-on: macos-14 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.x | |
- name: build dotnet executables | |
run: make build | |
- name: size of executables | |
run: make size | |
- name: file info | |
run: make file | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: bin/* | |
test: | |
defaults: | |
run: | |
shell: sh | |
needs: [build] | |
name: Test ${{ matrix.docker == true && matrix.alpine == true && 'linux-musl' || matrix.docker == true && matrix.alpine == false && 'linux' || matrix.os }}-${{ matrix.arch }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ | |
"macos-14", | |
"windows-latest", | |
"ubuntu-latest" | |
] | |
arch: ["amd64"] | |
alpine: [false] | |
include: | |
- os: "macos-14" | |
arch: "arm64" | |
- os: "ubuntu-latest" | |
arch: "arm64" | |
alpine: true | |
docker: true | |
- os: "ubuntu-latest" | |
arch: "amd64" | |
alpine: true | |
docker: true | |
- os: "ubuntu-latest" | |
arch: "arm64" | |
debian: true | |
docker: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: list artifact | |
run: ls artifact/* | |
- name: Set up QEMU | |
if: matrix.arch == 'arm64' && matrix.docker == true | |
uses: docker/setup-qemu-action@v3 | |
- name: test alpine ${{ matrix.arch }} package | |
if: ${{ matrix.alpine == true && matrix.arch == 'arm64' }} | |
run: docker run --platform=linux/${{ matrix.arch }} --rm -v $(pwd):/app alpine /bin/sh -c 'apk add --no-cache gcc icu && chmod +x ./app/artifact/hello_dotnet-linux-musl-arm64/Explore.Cli && ./app/artifact/hello_dotnet-linux-musl-arm64/Explore.Cli --version' | |
- name: test alpine ${{ matrix.arch }} package | |
if: ${{ matrix.alpine == true && matrix.arch == 'amd64' }} | |
run: docker run --platform=linux/${{ matrix.arch }} --rm -v $(pwd):/app alpine /bin/sh -c 'apk add --no-cache gcc icu && chmod +x ./app/artifact/hello_dotnet-linux-musl-x64/Explore.Cli && ./app/artifact/hello_dotnet-linux-musl-x64/Explore.Cli --version' | |
- name: test debian ${{ matrix.arch }} package | |
if: ${{ matrix.debian == true && matrix.arch == 'arm64' }} | |
run: docker run --platform=linux/${{ matrix.arch }} --rm -v $(pwd):/app debian /bin/bash -c 'apt update && apt install -y libicu-dev && chmod +x ./app/artifact/hello_dotnet-linux-arm64/Explore.Cli && ./app/artifact/hello_dotnet-linux-arm64/Explore.Cli --version' | |
- name: test debian ${{ matrix.arch }} package | |
if: ${{ matrix.debian == true && matrix.arch == 'amd64' }} | |
run: docker run --platform=linux/${{ matrix.arch }} --rm -v $(pwd):/app debian /bin/bash -c 'apt update && apt install -y libicu-dev && chmod +x ./app/artifact/hello_dotnet-linux-x64/Explore.Cli && ./app/artifact/hello_dotnet-linux-x64/Explore.Cli --version' | |
- name: test 'macos-14' | |
if: ${{ matrix.os == 'macos-14' }} | |
run: artifact/hello_dotnet-osx-arm64/Explore.Cli --version | |
- name: test 'macos-12' | |
if: ${{ matrix.os == 'macos-12' }} | |
run: artifact/hello_dotnet-osx-x64/Explore.Cli --version | |
- name: test 'windows-latest' | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: artifact/hello_dotnet-win-x64/Explore.Cli.exe --version | |
- name: test 'ubuntu-latest' | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.docker != true }} | |
run: artifact/hello_dotnet-linux-x64/Explore.Cli --version |