From 240060f49ac937b3582d91f13f6e6d66422ebcd6 Mon Sep 17 00:00:00 2001 From: LKedward Date: Mon, 30 Nov 2020 14:58:58 +0000 Subject: Update: CI to also test release version --- .github/workflows/CI.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8165ded..2b3b6bf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: STACK_CACHE_VERSION: "" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" + RELEASE_CMD: "fpm run ${{ env.RELEASE_FLAGS }} --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-linux-x86_64 HASH_CMD: ls fpm-*|xargs -i{} sh -c 'sha256sum $1 > $1.sha256' -- {} @@ -40,7 +40,7 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" + RELEASE_CMD: "fpm run ${{ env.RELEASE_FLAGS }} --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-macos-x86_64 HASH_CMD: ls fpm-*|xargs -I{} sh -c 'shasum -a 256 $1 > $1.sha256' -- {} @@ -51,13 +51,14 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } - RELEASE_CMD: fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) + RELEASE_CMD: fpm run ${{ env.RELEASE_FLAGS }} --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-bootstrap-v",(Get-Content fpm_version),"-windows-x86_64.exe")) HASH_CMD: Get-ChildItem -File -Filter "fpm-*" | Foreach-Object {echo (Get-FileHash -Algorithm SHA256 $PSItem | Select-Object hash | Format-Table -HideTableHeaders | Out-String) > (-join($PSItem,".sha256"))} env: FC: gfortran GCC_V: ${{ matrix.gcc_v }} + RELEASE_FLAGS: --flag -g --flag -fbacktrace --flag -O3 steps: - name: Checkout code @@ -120,11 +121,13 @@ jobs: if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | ci/run_tests.sh + ci/run_tests.sh ${{ env.RELEASE_FLAGS }} - name: Build and run Fortran fpm (Windows) if: contains(matrix.os, 'windows') run: | ci\run_tests.bat + ci\run_tests.bat ${{ env.RELEASE_FLAGS }} # ----- Upload binaries if creating a release ----- - name: Check that fpm --version matches release tag -- cgit v1.2.3 From 67a459170ce664a531d684337c57df809d528a9b Mon Sep 17 00:00:00 2001 From: Laurence Kedward Date: Mon, 30 Nov 2020 15:05:21 +0000 Subject: Update CI.yml --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2b3b6bf..ba0af66 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: STACK_CACHE_VERSION: "" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run ${{ env.RELEASE_FLAGS }} --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" + RELEASE_CMD: "fpm run $RELEASE_FLAGS --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-linux-x86_64 HASH_CMD: ls fpm-*|xargs -i{} sh -c 'sha256sum $1 > $1.sha256' -- {} @@ -40,7 +40,7 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run ${{ env.RELEASE_FLAGS }} --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" + RELEASE_CMD: "fpm run $RELEASE_FLAGS --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-macos-x86_64 HASH_CMD: ls fpm-*|xargs -I{} sh -c 'shasum -a 256 $1 > $1.sha256' -- {} @@ -51,7 +51,7 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } - RELEASE_CMD: fpm run ${{ env.RELEASE_FLAGS }} --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) + RELEASE_CMD: fpm run $RELEASE_FLAGS --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-bootstrap-v",(Get-Content fpm_version),"-windows-x86_64.exe")) HASH_CMD: Get-ChildItem -File -Filter "fpm-*" | Foreach-Object {echo (Get-FileHash -Algorithm SHA256 $PSItem | Select-Object hash | Format-Table -HideTableHeaders | Out-String) > (-join($PSItem,".sha256"))} @@ -153,4 +153,4 @@ jobs: file: fpm/fpm-* file_glob: true tag: ${{ github.ref }} - overwrite: true \ No newline at end of file + overwrite: true -- cgit v1.2.3 From 00443e00d5b0e07ce5a5ef7ec1bca6a7628b3b11 Mon Sep 17 00:00:00 2001 From: LKedward Date: Mon, 30 Nov 2020 16:43:34 +0000 Subject: Add --static flag back to binary releases --- .github/workflows/CI.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to '.github') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ba0af66..0761de2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,9 +29,10 @@ jobs: STACK_CACHE_VERSION: "" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run $RELEASE_FLAGS --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" + RELEASE_CMD: "cp -- fpm-v$(cat fpm_version)-linux-x86_64" BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-linux-x86_64 HASH_CMD: ls fpm-*|xargs -i{} sh -c 'sha256sum $1 > $1.sha256' -- {} + RELEASE_FLAGS: --flag --static --flag -g --flag -fbacktrace --flag -O3 - os: macos-latest STACK_CACHE: | @@ -40,9 +41,10 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) - RELEASE_CMD: "fpm run $RELEASE_FLAGS --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" + RELEASE_CMD: "cp -- fpm-v$(cat fpm_version)-macos-x86_64" BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-macos-x86_64 HASH_CMD: ls fpm-*|xargs -I{} sh -c 'shasum -a 256 $1 > $1.sha256' -- {} + RELEASE_FLAGS: --flag -g --flag -fbacktrace --flag -O3 - os: windows-latest STACK_CACHE: | @@ -51,14 +53,14 @@ jobs: STACK_CACHE_VERSION: "v2" GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } - RELEASE_CMD: fpm run $RELEASE_FLAGS --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) + RELEASE_CMD: copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-bootstrap-v",(Get-Content fpm_version),"-windows-x86_64.exe")) HASH_CMD: Get-ChildItem -File -Filter "fpm-*" | Foreach-Object {echo (Get-FileHash -Algorithm SHA256 $PSItem | Select-Object hash | Format-Table -HideTableHeaders | Out-String) > (-join($PSItem,".sha256"))} + RELEASE_FLAGS: --flag --static --flag -g --flag -fbacktrace --flag -O3 env: FC: gfortran GCC_V: ${{ matrix.gcc_v }} - RELEASE_FLAGS: --flag -g --flag -fbacktrace --flag -O3 steps: - name: Checkout code @@ -121,13 +123,13 @@ jobs: if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | ci/run_tests.sh - ci/run_tests.sh ${{ env.RELEASE_FLAGS }} + ci/run_tests.sh ${{ matrix.RELEASE_FLAGS }} - name: Build and run Fortran fpm (Windows) if: contains(matrix.os, 'windows') run: | ci\run_tests.bat - ci\run_tests.bat ${{ env.RELEASE_FLAGS }} + ci\run_tests.bat ${{ matrix.RELEASE_FLAGS }} # ----- Upload binaries if creating a release ----- - name: Check that fpm --version matches release tag @@ -141,7 +143,7 @@ jobs: if: github.event_name == 'release' run: | cd fpm - ${{ matrix.RELEASE_CMD }} + fpm run ${{ matrix.RELEASE_FLAGS }} --runner ${{ matrix.RELEASE_CMD }} ${{ matrix.BOOTSTRAP_RELEASE_CMD }} ${{ matrix.HASH_CMD }} -- cgit v1.2.3 From cbd75552604ac119211534a5d4b7fd79f18e7786 Mon Sep 17 00:00:00 2001 From: LKedward Date: Tue, 1 Dec 2020 13:04:16 +0000 Subject: Separate CI job steps for debug and release builds --- .github/workflows/CI.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to '.github') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0761de2..f42d8ff 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,6 +27,7 @@ jobs: - os: ubuntu-latest STACK_CACHE: "/home/runner/.stack/" STACK_CACHE_VERSION: "" + TEST_SCRIPT: ci/run_tests.sh GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "cp -- fpm-v$(cat fpm_version)-linux-x86_64" @@ -39,6 +40,7 @@ jobs: /Users/runner/.stack/snapshots /Users/runner/.stack/setup-exe-src STACK_CACHE_VERSION: "v2" + TEST_SCRIPT: ci/run_tests.sh GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "cp -- fpm-v$(cat fpm_version)-macos-x86_64" @@ -51,6 +53,7 @@ jobs: C:\Users\runneradmin\AppData\Roaming\stack C:\Users\runneradmin\AppData\Local\Programs\stack STACK_CACHE_VERSION: "v2" + TEST_SCRIPT: ci\run_tests.bat GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } RELEASE_CMD: copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) @@ -119,17 +122,11 @@ jobs: cd bootstrap stack test - - name: Build and run Fortran fpm (Linux / macOS) - if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') - run: | - ci/run_tests.sh - ci/run_tests.sh ${{ matrix.RELEASE_FLAGS }} + - name: Build and test Fortran fpm + run: ${{ matrix.TEST_SCRIPT }} - - name: Build and run Fortran fpm (Windows) - if: contains(matrix.os, 'windows') - run: | - ci\run_tests.bat - ci\run_tests.bat ${{ matrix.RELEASE_FLAGS }} + - name: Build and test Fortran fpm (release version) + run: ${{ matrix.TEST_SCRIPT }} ${{ matrix.RELEASE_FLAGS }} # ----- Upload binaries if creating a release ----- - name: Check that fpm --version matches release tag -- cgit v1.2.3