Skip to content

Remove unused variable #650

Remove unused variable

Remove unused variable #650

Workflow file for this run

# Build and test MAD-X on several platforms using GNU make.
#
# TODO:
# - follow up on the following issues and re-enable the corresponding settings:
# - ubuntu-18.04: test failures: test-survey-3 test-thick-quad-2 test-track-9
# - ubuntu-20.04: internal compiler error
# - windows-latest: test failures: test-match-10
# - coverage: enable on windows/macos (internal compiler error)
name: make
on:
push:
pull_request:
env:
# Without this, tons of tests fail due to incorrect output ordering...
# Someone should take a look why the code in mad_main.c doesn't work?
GFORTRAN_UNBUFFERED_PRECONNECTED: y
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
flags:
- i=1 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
- i=2 STATIC=no ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=yes
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
set -ex
sudo apt-get update
sudo apt-get install -qy \
libblas-dev \
liblapack-dev \
gfortran \
gnuplot
pip install cpp-coveralls
- name: Build MAD-X
run: |
set -ex
make madx-linux$ARCH-gnu ${{ matrix.flags }} COVERAGE=yes
# numdiff must be built without COVERAGE to avoid linker errors:
make numdiff-linux$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
env:
ARCH: ${{ contains(matrix.flags, 'ARCH=32') && '32' || '64' }}
- name: Upload artifact executable
if: matrix.os == ' ubuntu-22.04' && matrix.flags == 'i=1 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no'
uses: actions/upload-artifact@v3
with:
name: madx-linux64
path: madx-linux64-gnu
- name: Run tests
id: tests
# TODO: debug why these 3 tests are failing, and re-enable:
run: |
.github/utils/make_tests ${{
matrix.os == 'ubuntu-18.04'
&& 'tests-to-rm="test-survey-3 test-thick-quad-2 test-track-9"'
|| ''
}}
- name: Set artifact name suffix
if: failure() && steps.tests.outcome == 'failure'
id: jobname
run: |
${{ matrix.flags }}
.github/utils/set-output i $i
- name: Upload test outputs for inspection
# This below condition looks redundant - but there is something about
# the failure() and always() functions that prevents an implicit
# `if success()` that would otherwise be conditioned on.
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-${{ matrix.os }}-${{ steps.jobname.outputs.i }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}
- name: Upload coverage results
if: env.COVERALLS_REPO_TOKEN != ''
run: coveralls --include src -x .c -x .cpp
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
flags:
- i=1 STATIC=no ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
- i=2 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
brew install gnuplot
- name: Setup gcc/gfortran
run: |
ls /usr/local/bin/gfortran*
set -ex
sudo ln -s $(which gcc-12) /usr/local/bin/gcc
sudo ln -s $(which g++-12) /usr/local/bin/g++
sudo ln -s $(which gfortran-12) /usr/local/bin/gfortran
- name: Build MAD-X
run: |
set -ex
# COVERAGE=yes currently fails with internal compiler error in
# match.f90:1917:0:
make madx-macosx$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
make numdiff-macosx$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
env:
ARCH: ${{ contains(matrix.flags, 'ARCH=32') && '32' || '64' }}
- name: Upload artifact executable
uses: actions/upload-artifact@v3
with:
name: madx-macosx
path: madx-macosx64-gnu
- name: Run tests
id: tests
run: |
.github/utils/make_tests
- name: Set artifact name suffix
if: failure() && steps.tests.outcome == 'failure'
id: jobname
run: |
${{ matrix.flags }}
.github/utils/set-output i $i
- name: Upload test outputs for inspection
# This below condition looks redundant - but there is something about
# the failure() and always() functions that prevents an implicit
# `if success()` that would otherwise be conditioned on.
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-${{ matrix.os }}-${{ steps.jobname.outputs.i }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}
windows:
runs-on: windows-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- bits: 32
arch: i686
- bits: 64
arch: x86_64
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW${{ matrix.bits }}
install: >-
base-devel
mingw-w64-${{ matrix.arch }}-toolchain
- name: Build MAD-X
run: make all-win${{ matrix.bits }}-gnu
- name: Upload artifact executable
uses: actions/upload-artifact@v3
with:
name: madx-windows
path: |
build
madx-win64-gnu.exe
- name: Run tests
# Skip 32bit build - it's broken and mind-boggelingly slow (>>2h)!
if: matrix.bits != 32
id: tests
run: |
# TODO: fix test-match-10 failure and reenable
.github/utils/make_tests \
tests-to-rm="test-plot test-match-10 test-read-write-hex" \
ARCH=${{ matrix.bits }}
- name: Upload failed tests output for inspection
# Keep the redundant condition (see above)!
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-win${{ matrix.bits }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}