Skip to content

Commit

Permalink
Expanded linux/windows builders
Browse files Browse the repository at this point in the history
Instead of having if-statements on every single line, let's just
separate out the build jobs.
  • Loading branch information
michaelmalonenz committed Feb 19, 2024
1 parent a4ac978 commit 6b70d45
Showing 1 changed file with 52 additions and 38 deletions.
90 changes: 52 additions & 38 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,47 @@ name: C/C++ CI
on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build-test
shell: bash
run: cmake -B build -S . -DCMAKE_SYSTEM_VERSION="10.0.20348.0"
- run: cmake --build build --target all --target test --target stdlib_test
if: ${{ runner.os == 'Linux' }}
run: |
cmake -B build -S .
cmake --build build --target all --target test --target stdlib_test
build-windows:
runs-on: windows-latest

steps:
- name: build-test
run: |
cmake -B build -S . -DCMAKE_SYSTEM_VERSION="10.0.20348.0"
cmake --build build --target ALL_BUILD --target RUN_TESTS
# - run: cmake --build build --target ALL_BUILD --target RUN_TESTS --target stdlib_test
# if: ${{ runner.os == 'Windows' }}
- run: cmake --build build --target ALL_BUILD --target RUN_TESTS
if: ${{ runner.os == 'Windows' }}

build-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

build-release-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build
shell: bash
run: cmake -B release -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION="10.0.20348.0" -DVERSION=${{ github.ref_name }}
- run: cmake --build release --target all
if: ${{ runner.os == 'Linux' }}
- run: cmake --build release --target ALL_BUILD --config Release
if: ${{ runner.os == 'Windows' }}

- name: Create-Archive-Linux
if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' }}
shell: bash
run: zip -j comet_linux_${{ github.ref_name }}.zip release/comet/comet stdlib/comet/*.cmt

- name: Release-Linux
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' }}
with:
files: comet_linux_${{ github.ref_name }}.zip
run: |
cmake -B release -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION="10.0.20348.0" -DVERSION=${{ github.ref_name }}
cmake --build release --target ALL_BUILD --config Release
- name: Create-Archive-Windows
- name: Create-Archive
shell: powershell
if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir output
cp release\comet\Release\comet.exe output
Expand All @@ -63,6 +52,31 @@ jobs:
- name: Release-Windows
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: comet_windows_${{ github.ref_name }}.zip

build-release-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: build
shell: bash
run: |
cmake -B release -S . -DCMAKE_BUILD_TYPE=Release -DVERSION=${{ github.ref_name }}
cmake --build release --target all
- name: Create-Archive
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: bash
run: zip -j comet_linux_${{ github.ref_name }}.zip release/comet/comet stdlib/comet/*.cmt

- name: Release-Linux
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: comet_linux_${{ github.ref_name }}.zip

0 comments on commit 6b70d45

Please sign in to comment.