Skip to content

Commit

Permalink
Merge branch 'fortran-lang:main' into fpm-search
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 committed Jun 22, 2024
2 parents 8496b5c + 06cdf47 commit 4beb573
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 38 deletions.
41 changes: 23 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ 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
run: |
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 }}
Expand All @@ -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'
Expand Down Expand Up @@ -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}
Expand All @@ -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' }}
Expand All @@ -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
Expand All @@ -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
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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
22 changes: 22 additions & 0 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions src/fpm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fpm_compiler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 :: &
Expand Down

0 comments on commit 4beb573

Please sign in to comment.