-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of having if-statements on every single line, let's just separate out the build jobs.
- Loading branch information
1 parent
a4ac978
commit 6b70d45
Showing
1 changed file
with
52 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |