Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of GitHub CI #107

Merged
merged 39 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1043d42
Adding a GitHub workflow to trigger a GitHub CI build, as an experiment.
rptb1 Jan 11, 2023
f7e3de4
Disabling Travis CI on this branch while experimenting with GitHub CI.
rptb1 Jan 11, 2023
598ca3e
Possibly removing condition that the workflow only works on the defau…
rptb1 Jan 11, 2023
0e5a067
Fixing YAML syntax.
rptb1 Jan 11, 2023
0770296
Merge branch branch/2023-01-06/gcc-11.3.0-warnings into branch/2023-0…
rptb1 Jan 11, 2023
46bf2f7
Extending job to run on macOS using a build matrix.
rptb1 Jan 11, 2023
5561cdf
Using the matrix output as input to the job's runs-on parameter.
rptb1 Jan 11, 2023
6d3fc4b
Adding a Windows build to GitHub CI.
rptb1 Jan 11, 2023
d6b1347
Visual Studio tools aren't in CMD in GitHub CI by default. Try using…
rptb1 Jan 11, 2023
1f65c8b
Trying a path to Visual Studio environment documented by GitHub <http…
rptb1 Jan 11, 2023
a538a5e
Quoting path to Visual Studio environment to try to get CMD to run it…
rptb1 Jan 11, 2023
36eea75
GitHub CI's CMD exited right after the first line, so perhaps the run…
rptb1 Jan 11, 2023
0a58a2d
Merge branch/2023-01-10/travis-freebsd into branch/2023-01-11/github-…
rptb1 Jan 11, 2023
ebaad53
Moving Linux, macOS, and Windows builds to Github CI.
rptb1 Jan 11, 2023
ce05f9a
Re-enabling arm64 builds, because GitHub CI does not provide them.
rptb1 Jan 13, 2023
840b50d
Explicitly excluding macOS on amd64 after observing it was included i…
rptb1 Jan 13, 2023
c958598
Another attempt to suppress macOS on amd64, after observing it was st…
rptb1 Jan 13, 2023
59c8974
Adding test targets to GitHub CI on Windows.
rptb1 Jan 14, 2023
ff63810
Add workflow_dispatch trigger to workflow so that it can be started m…
rptb1 Jan 15, 2023
92d2d5c
Adding tool scripts to kick off CI builds on Travis CI and GitHub.
rptb1 Jan 15, 2023
a48233b
Oops. Deleting literal token and replacing with parameter. Also corre…
rptb1 Jan 15, 2023
01175c6
Renaming the c-cpp workflow to build-and-test, which expresses better…
rptb1 Jan 15, 2023
6bf2447
Adding TODO note about kicking off other CI actions.
rptb1 Jan 15, 2023
b420b85
Adding explicit build for LII6LL.
rptb1 Jan 15, 2023
44378f1
Attempt to persuade the build matrix to use environment dimension to …
rptb1 Jan 15, 2023
528e67d
Second attempt to include environment in the build matrix.
rptb1 Jan 15, 2023
f809296
Third attempt to use environment variables to select the compiler.
rptb1 Jan 15, 2023
2aeee8f
Fourth attempt to use environment variables to select the compiler.
rptb1 Jan 15, 2023
086eca6
Attempt to add custom dimension to the build matrix to simplify and e…
rptb1 Jan 15, 2023
559c065
Tidying up and cross-referencing the Travis CI config for missing pla…
rptb1 Jan 15, 2023
6a97cbf
Discovered that design.mps.test is not referenced from the CI configs…
rptb1 Jan 15, 2023
99e1acf
Making design.mps.tests.ci correct, though it needs further work.
rptb1 Jan 15, 2023
748b7b8
Extensive restructuring of CI section to lift common facts between Gi…
rptb1 Jan 15, 2023
649a0b7
Miscellaneous corrections found by reading through the presentation o…
rptb1 Jan 15, 2023
d423faa
Adding more commentary on things yet to document.
rptb1 Jan 15, 2023
f6b801b
Upgrading CI configs to first class documents with licensing, cross-r…
rptb1 Jan 15, 2023
3243ee5
Can't link to things that don't exist yet. Leaving a note.
rptb1 Jan 15, 2023
8ce1a93
Swapping BSD licence for MIT because we must retain the original lice…
rptb1 Jan 16, 2023
f507e55
Catch-up merge with master into branch/2023-01-11/github-ci to elimin…
rptb1 Jan 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# .github/workflows/build-and-test.yml -- GitHub CI build and test configuration for the MPS
#
# Copyright (c) 2019-2022 `GitHub contributors`_ (MIT License).
# Copyright (c) 2023 Ravenbrook Limited. See end of file for license.
#
# See design.mps.test.ci.
#
# TODO: Exclude certain branches.
#
# TODO: Regular builds of version branches. See
# <https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule>.

name: build and test

on:
- push
- pull_request
# Also run when triggered manually, e.g. by tool/github-ci-kick
# <https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow>
- workflow_dispatch

jobs:

posix:

# The build matrix for GitHub CI on Posix platforms
#
# See design.mps.tests.ci.github.platforms.
#
# FreeBSD and ARM64 targets are in Travis CI, configured by
# .travis.yml.
#
# See <https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy>.

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [clang, gcc]
exclude:
- os: macos-latest
compiler: gcc

runs-on: ${{ matrix.os }}

# See design.mps.tests.ci.run.posix.
steps:
- uses: actions/checkout@v3
- run: CC=${{ matrix.compiler }} ./configure
- run: make
- run: make test

windows:

runs-on: windows-latest

# See design.mps.tests.ci.run.windows.
#
# The path to Visual Studio is documented at
# <https://github.com/actions/runner-images/blob/e6fcf60b8e6c0f80a065327eaefe836881c28b68/images/win/Windows2022-Readme.md?plain=1#L215>.

steps:
- uses: actions/checkout@v3
- run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cd code
nmake /f w3i6mv.nmk all testci testansi testpollnone
shell: cmd


# A. REFERENCES
#
# [GitHub CI] "About continuous integration"; <https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration>.
#
#
# B. DOCUMENT HISTORY
#
# 2023-01-11 RB Adapted from <https://github.com/actions/starter-workflows/blob/9f245d9aba830ad16a097a45c78331a05114d815/ci/c-cpp.yml>.
# 2023-01-15 RB Added licence and document history.
#
#
# C. COPYRIGHT AND LICENSE
thejayps marked this conversation as resolved.
Show resolved Hide resolved
#
# NOTE: This is the `MIT Licence <https://opensource.org/licenses/MIT>`_
# inherited from
# <https://github.com/actions/starter-workflows/blob/9f245d9aba830ad16a097a45c78331a05114d815/ci/c-cpp.yml> and not the usual licence for the MPS.
#
# Copyright (c) 2019-2022 `GitHub contributors`_.
# Copyright (c) 2023 Ravenbrook Limited <https://www.ravenbrook.com/>.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# .. _GitHub contributors: https://github.com/actions/starter-workflows/commits/1d9d6d7fb0a8a27ef98efbbfa9689cd14c906383/ci/c-cpp.yml
#
#
# $Id$
79 changes: 69 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
# .travis.yml -- Travis CI configuration for the MPS
# $Id$
#
# Copyright (c) 2013-2023 Ravenbrook Limited. See end of file for license.
#
# See design.mps.test.ci.

# Some branches don't need builds. Add them here to avoid using build
# resources and unnecessary build messages. See
# <https://docs.travis-ci.com/user/conditions-v1>.
if: NOT branch IN (branch/2023-01-07/pull-request-merge-procedure)
rptb1 marked this conversation as resolved.
Show resolved Hide resolved
if: NOT branch IN (branch/2023-01-11/github-ci)

# The main build matrix for POSIX-like systems.
language: c # see <https://docs.travis-ci.com/user/languages/c/>.

# The build matrix for Travis CI
#
# See design.mps.tests.ci.travis.platforms.
#
# Most x86_64/amd64 builds are in GitHub CI, configured by
# .github/workflows/build-and-test.yml.

os:
- freebsd
- linux
- osx
# See "include" section for Windows
arch:
- amd64
- arm64
compiler:
- clang
- gcc
script:

script: # see design.mps.test.ci.run.posix
- ./configure --prefix=$PWD/prefix && make install && make test

matrix:

# Extra build jobs to add to the matrix
include:
- os: windows

# GitHub CI does not provide FreeBSD
# <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources>
# on any architecture, so we add it here for amd64. See also
# design.mps.tests.ci.travis.platforms.

- os: freebsd
arch: amd64
compiler: clang # This is a lie since we invoke MV (Microsoft C)
script: MSYS2_ARG_CONV_EXCL='*' cmd /c 'code\w3i6mv.bat'
compiler: clang
- os: freebsd
arch: amd64
compiler: gcc

# Specific combinations to exclude from the matrix
exclude:
- os: osx
Expand All @@ -42,3 +60,44 @@ notifications:
#before_install:
# - if test "$TRAVIS_OS_NAME" = "linux"; then sudo apt-get -qq update; fi
# - if test "$TRAVIS_OS_NAME" = "linux"; then sudo apt-get install -y gcc-4.7; fi


# A. REFERENCES
#
#
# B. DOCUMENT HISTORY
#
# 2013-05-19 RB Created.
# 2023-01-15 RB Added licence and (note) document history.
#
#
# C. COPYRIGHT AND LICENSE
#
# Copyright (C) 2013-2023 Ravenbrook Limited <https://www.ravenbrook.com/>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# $Id$
Loading