diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16025d299a..778f8f40da 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -173,7 +173,7 @@ jobs: rm -v ${{ env.FPM }} echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV env: - EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }} + EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}-gcc-${{ matrix.gcc_v }}${{ matrix.exe }} - name: Run release version shell: bash @@ -181,7 +181,7 @@ jobs: ci/run_tests.sh "$PWD/${{ env.FPM_RELEASE }}" - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.FPM_RELEASE }} path: ${{ env.FPM_RELEASE }} @@ -192,14 +192,19 @@ jobs: runs-on: windows-latest needs: - build + strategy: + fail-fast: false + matrix: + gcc_v: [10,11,12] steps: - uses: actions/checkout@v4 - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - path: ${{ github.workspace }} # This will download all files + path: ${{ github.workspace }} + pattern: fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe - name: Get version (normal) if: github.event_name != 'release' @@ -229,7 +234,7 @@ jobs: - name: Fetch Windows executable shell: msys2 {0} run: | - cp fpm-*/fpm*.exe ./ci/fpm.exe + cp fpm-*/fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe ./ci/fpm.exe - name: Fetch Git for Windows shell: msys2 {0} @@ -254,13 +259,13 @@ jobs: run: | cd ./ci makensis fpm-installer.nsi - move fpm-installer.exe fpm-installer-${{ env.VERSION }}.exe + move fpm-installer.exe fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }}.exe - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: fpm-installer - path: ci/fpm-installer-${{ env.VERSION }}.exe + name: fpm-installer-gcc-${{ matrix.gcc_v }} + path: ci/fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }}.exe upload-artifacts: if: ${{ github.event_name == 'release' && contains(github.ref, 'v') || github.event_name == 'push' }} @@ -281,27 +286,27 @@ jobs: if: ${{ github.event_name == 'push' }} - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - path: ${{ github.workspace }} # This will download all files + path: fpm-cd-artifacts + pattern: 'fpm-*-gcc-12*' + merge-multiple: true - name: Normalize file names for continuous delivery if: ${{ github.event_name == 'push' }} run: | - for output in fpm-*/fpm*; do - pushd $(dirname "$output") + cd fpm-cd-artifacts + for output in fpm-*; do mv -v $(basename $output) $(basename $output | sed -E '${{ env.replace }}') - popd done env: replace: 's/-([0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g)?[0-9a-f]+//' - name: Create SHA256 checksums run: | - for output in fpm-*/fpm*; do - pushd $(dirname "$output") + cd fpm-cd-artifacts + for output in fpm-*; do sha256sum $(basename "$output") | tee $(basename "$output").sha256 - popd done - name: Move/Create continuous tag @@ -315,7 +320,7 @@ jobs: if: ${{ github.event_name == 'release' || steps.deploy-on-push.outputs.result != 0 }} with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm-*/fpm* + file: fpm-cd-artifacts/* file_glob: true tag: ${{ github.event_name == 'release' && github.ref || 'current'}} overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a37ca316b..d55c190e75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: PREFIX: fpm-${{ env.VERSION }}/ - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.OUTPUT }} path: ${{ env.OUTPUT }} @@ -104,7 +104,7 @@ jobs: ${{ env.EXE }} build - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.OUTPUT }} path: ${{ env.OUTPUT }} @@ -128,27 +128,26 @@ jobs: if: ${{ github.event_name == 'push' }} - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - path: ${{ github.workspace }} # This will download all files + path: fpm-cd-artifacts + merge-multiple: true - name: Normalize file names for continuous delivery if: ${{ github.event_name == 'push' }} run: | - for output in fpm-*/fpm*; do - pushd $(dirname "$output") + cd fpm-cd-artifacts + for output in fpm-*; do mv -v $(basename $output) $(basename $output | sed -E '${{ env.replace }}') - popd done env: replace: 's/-([0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g)?[0-9a-f]+//' - name: Create SHA256 checksums run: | - for output in fpm-*/fpm*; do - pushd $(dirname "$output") + cd fpm-cd-artifacts + for output in fpm-*; do sha256sum $(basename "$output") | tee $(basename "$output").sha256 - popd done - name: Move/Create continuous tag @@ -162,7 +161,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm-*/fpm* + file: fpm-cd-artifacts/* file_glob: true tag: ${{ github.event_name == 'release' && github.ref || 'current'}} overwrite: true diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 0b7fc8e057..c1abbb5e7f 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -81,14 +81,36 @@ do echo "$filename" "$fpm" ${cmdrun[$j]} $filename test -e $filename.txt + # non-i-th tests should not have run for k in ${others[@]} do test ! -e ${targets[$k]}$k.txt done done done + +# Test building all targets and with runner +if [[ "$(which time)" ]]; then +targets=( "run" "run --example" "test" ) +names=( "run" "example" "test" ) +cmdrun=( " " " --runner time" ) +for j in {0..2} +do + for i in {0..1} + do + rm -f *.txt + "$fpm" ${targets[$j]}${cmdrun[$i]} + # all targets should have run + for k in ${cases[@]} + do + test -e ${names[$j]}$k.txt + done + done +done +fi popd + pushd auto_discovery_off "$fpm" build "$fpm" run --target auto_discovery_off diff --git a/src/fpm.f90 b/src/fpm.f90 index b162ff2827..561fb4e5e9 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -486,7 +486,6 @@ subroutine cmd_run(settings,test) integer :: run_scope,firsterror integer, allocatable :: stat(:),target_ID(:) character(len=:),allocatable :: line - logical :: toomany call get_package_data(package, "fpm.toml", error, apply_defaults=.true.) if (allocated(error)) then @@ -547,13 +546,8 @@ subroutine cmd_run(settings,test) end if ! Check all names are valid - ! or no name and found more than one file - toomany= size(settings%name)==0 .and. size(executables)>1 - if ( any(.not.found) & - & .or. & - & ( (toomany .and. .not.test) .or. (toomany .and. settings%runner /= '') ) & - & .and. & - & .not.settings%list) then + ! or no name and found more than one file + if ( any(.not.found) ) then line=join(settings%name) if(line/='.')then ! do not report these special strings if(any(.not.found))then diff --git a/src/fpm_compiler.F90 b/src/fpm_compiler.F90 index f173267659..1aa2581d00 100644 --- a/src/fpm_compiler.F90 +++ b/src/fpm_compiler.F90 @@ -235,7 +235,7 @@ module fpm_compiler flag_lfortran_opt = " --fast", & flag_lfortran_openmp = " --openmp", & flag_lfortran_implicit_typing = " --implicit-typing", & - flag_lfortran_implicit_external = " --allow-implicit-interface", & + flag_lfortran_implicit_external = " --implicit-interface", & flag_lfortran_fixed_form = " --fixed-form" character(*), parameter :: &