From 6981e20731b5b8329e4a1da05d706026e081c8fc Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 18 May 2024 17:17:00 +0000 Subject: [PATCH 1/3] ogma-cli: Introduce CI test job. Refs #139. Ogma doesn't currently rely on Travis CI for testing, because Travis is setup to run on all NASA repositories and we run out of cycles very quickly. We need to automate the testing process as much as possible regardless, and follow our own guide for compliance with NPR7150.2D but using Github instead of Travis CI. This commit introduces a Github Actions file that builds the source code in every push action and with every pull requests. --- .github/workflows/repo-ghc-8.6-cabal-2.4.yml | 63 ++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/repo-ghc-8.6-cabal-2.4.yml diff --git a/.github/workflows/repo-ghc-8.6-cabal-2.4.yml b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml new file mode 100644 index 00000000..4eaa7bbc --- /dev/null +++ b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml @@ -0,0 +1,63 @@ +name: install-hackage-ghc-8.6-cabal-2.4 + +# Trigger the workflow on push or pull request +on: + - pull_request + - push + +jobs: + cabal: + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + cabal: ["2.4"] + ghc: + - "8.6" + + steps: + + - uses: haskell-actions/setup@main + id: setup-haskell-cabal + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Prepare environment + run: | + echo "$HOME/.ghcup/bin" >> $GITHUB_PATH + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + + - uses: actions/checkout@v4 + + - name: Create sandbox + run: | + echo "$PWD/.cabal-sandbox/bin" >> $GITHUB_PATH + cabal v1-sandbox init + + - name: Install dependencies + run: | + cabal v1-install alex happy + + - name: Install ogma + run: | + # Some tests need the ogma executable to be in the path, which won't + # happen until installation completes successfully (which only happens + # after tests if running tests is enabled). We therefore need to run + # the installation twice: once without --run-tests, and again with + # --run-tests. + # + # We still --enable-tests in the first compilation to make sure that + # the dependencies do not change and cabal does not change the + # installation plan (which would mean we'd be running the tests with a + # version of ogma compiled with different dependencies). + cabal v1-install ogma-**/ --enable-tests + + - name: Test all packages + run: | + # We want to document the build process, and get detailed information + # if there is a problem (or if all goes well). We therefore execute the + # installation with -j1. + cabal v1-install ogma-**/ --enable-tests --run-tests -j1 From 2b461d284b03421050c19b2873e48a36915310f3 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 03:47:50 +0000 Subject: [PATCH 2/3] ogma-cli: Remove old travis file. Refs #139. A prior commit has introduced a Github Actions file to build Ogma with every push and every pull request. This commit removes the corresponding Travis CI file, since it no longer makes sense to keep it. --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c15cddc8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: haskell - -ghc: - - "8.8.4" - -env: - - PATH=${HOME}/.cabal/bin:${PATH} - -before_install: - - travis_retry sudo apt-get update - -install: - - travis_retry cabal install alex happy - - travis_retry cabal install --enable-tests --only-dependencies ogma-**/ - -script: - # We want to document the build process, and get detailed information if - # there is a problem (or if all goes well). We therefore execute the - # installation with -j1. - # - # Some tests need the ogma executable to be in the path, which won't happen - # until installation completes successfully (which only happens after tests - # if running tests is enabled). We therefore need to run the installation - # twice: once without --run-tests, and again with --run-tests. - # - # We still --enable-tests in the first compilation to make sure that the - # dependencies do not change and cabal does not change the installation plan - # (which would mean we'd be running the tests with a version of ogma compiled - # with different dependencies). - - cabal install --enable-tests -j1 ogma-**/ - - cabal install --run-tests -j1 ogma-**/ - -after_script: - -branches: - only: - - master - - /^develop.*$/ - - /^hotfix.*$/ - - /^release.*$/ From 6fa05dd159d4952d6aa2e4bbc8867f7183e9d561 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 02:58:15 +0000 Subject: [PATCH 3/3] ogma-cli: Document changes in CHANGELOG. Refs #139. --- ogma-cli/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 0a59d3f3..f02196b6 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -1,5 +1,8 @@ # Revision history for ogma-cli +## [1.X.X] - 2024-05-19 +* Introduce CI test job (#139). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133).