name: CI on: [push, pull_request] env: CI: "ON" # We can detect this in the build system and other vendors implement it HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker HOMEBREW_NO_AUTO_UPDATE: "ON" HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" HOMEBREW_NO_GITHUB_API: "ON" HOMEBREW_NO_INSTALL_CLEANUP: "ON" RUST_BACKTRACE: "full" # Make Rust print full backtrace on error jobs: Build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] gcc_v: [9] # Version of GFortran we want to use. env: FC: gfortran GCC_V: ${{ matrix.gcc_v }} steps: - name: Checkout code uses: actions/checkout@v1 - name: Install GFortran macOS if: contains(matrix.os, 'macos') run: | ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran which gfortran-${GCC_V} which gfortran - name: Install Haskell macOS if: contains(matrix.os, 'macos') run: | mkdir /Users/runner/.local/bin curl -L https://gist.github.com/certik/0e35f35753ae76f0f575d9b3d3f53633/raw/4cde02cc9215635c9401c2257a46be319e7ab6dd/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C /Users/runner/.local/bin - name: Install Haskell Linux if: contains(matrix.os, 'ubuntu') uses: mstksg/setup-stack@v1 - name: Install Haskell Windows if: contains(matrix.os, 'windows') run: | (New-Object System.Net.WebClient).DownloadFile("https://get.haskellstack.org/stable/windows-x86_64.zip", "windows-x86_64.zip") mkdir stack-tmp cd stack-tmp unzip ..\windows-x86_64.zip copy stack.exe "C:\Program Files\Git\usr\bin" cd .. - name: Install GFortran Linux if: contains(matrix.os, 'ubuntu') run: | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} - name: Build Haskell fpm run: | cd bootstrap stack build stack install - name: put fpm to PATH (macOS) if: contains(matrix.os, 'macos') run: | cp /Users/runner/.local/bin/fpm /usr/local/bin - name: put fpm to PATH (Windows) if: contains(matrix.os, 'windows') run: | copy "C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe" "C:\Program Files\Git\usr\bin" - name: Run tests on Haskell fpm run: | cd bootstrap stack test - name: Build and run Fortran fpm run: | cd fpm fpm build fpm run