From b0e63ce676a9adad34c725e0812c2bd85a33a87a Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 5 Sep 2023 13:54:05 +1200 Subject: [PATCH] [ci] Work towards setting up GHA --- .github/workflows/ci.yml | 169 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 112 -------------------------- 2 files changed, 169 insertions(+), 112 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..189dc99d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,169 @@ +name: CI + +on: + push: + paths-ignore: + - '*.rst' + - NEWS + pull_request: + branches: master + paths-ignore: + - '*.rst' + - NEWS + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +##env: +##global: MAKE=make +##dist: xenial + +jobs: + strategy: + matrix: + include: + - name: "C distribution build" + CFLAGS_DIST_BUILD: '-O2 -Wall -W -std=c90 -Wdeclaration-after-statement -Werror' + - name: "C distribution build (clang)" + CFLAGS_DIST_BUILD: '-O2 -Wall -W -std=c90 -Wdeclaration-after-statement -Werror' + CC: clang + - name: "C" + c_tests: y + CFLAGS: '-O2 -Wall -W -std=c99 -Werror' + - name: "C (clang)" + c_tests: y + CFLAGS: '-O2 -Wall -W -std=c99 -Werror' + CC: clang + - name: java + JAVA: java + JAVAC: javac + - name: go + # 20.04: golang-1.13 14 16 18 20 + # 22.04: golang-1.13 17 18 20 + GO: go +# - language: node_js +# node_js: "node" +# env: NODE=node +# dist: focal # seems to be needed for working node +# - language: rust +# rust: +# - stable +# - beta +# dist: bionic +# env: RUST=rust +# - language: csharp +# arch: amd64 # csharp doesn't seem to work on arm64 +# env: MCS=mcs +# dist: bionic +# - name: Pascal +# env: FPC=fpc +# dist: bionic +# addons: +# apt: +# packages: +# - fpc +# # The pure Python versions run slowly so we need to thin the testdata +# # for languages such as Arabic where there's a lot, or else the build +# # hits the travis time limit. With pypy, it's enough faster than we +# # can run the full tests. +# - language: python +# python: "3.9" +# env: PYTHON=python THIN_FACTOR=10 +# - language: python +# python: "3.7" +# env: PYTHON=python THIN_FACTOR=10 +# - language: python +# python: "3.6" +# env: PYTHON=python THIN_FACTOR=10 +# - language: python +# python: "pypy3.7-7.3.5" +# env: PYTHON=python +# dist: bionic +# - name: "Ada" +# env: gprbuild=gprbuild +# dist: bionic +# addons: +# apt: +# packages: +# - gnat +# - gprbuild +# - os: windows +# language: c +# env: c_tests=y MAKE=mingw32-make +# - os: windows +# language: go +# env: GO=go MAKE=mingw32-make + + fail-fast: false + + runs-on: ${{ matrix.os || 'ubuntu-latest' }} + + #env: + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Checkout data + run: | + # Try to check out a branch of the same name from the snowball-data + # repo sibling of this snowball repo, so that PRs requiring changes to + # both can be CI tested easily. + # + # If that fails, just use the standard snowball-data repo's default + # branch. + git status + echo "${{ github }}" +# GH_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} +# - GH_REPO_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG} +# - GH_REPO_URL=https://github.com/${GH_REPO_SLUG%%/*}/snowball-data.git +# - echo "Trying branch $GH_BRANCH from $GH_REPO_URL" +# - git clone --depth=1 -b "$GH_BRANCH" "$GH_REPO_URL" || git clone --depth=1 https://github.com/snowballstem/snowball-data.git + + - name: Install CCache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ matrix.name }} +#script: +# # Ensure CC is set for building the compiler in non-C builds. +# - test -n "$CC" || export CC=gcc +# - $MAKE CC="$CC" +# - test -z "$CFLAGS_DIST_BUILD" || { pip install setuptools && $MAKE dist && mkdir tmp && cd tmp && tar xf ../dist/libstemmer_c-*.tar.gz && cd libstemmer_c-* && $MAKE CFLAGS="$CFLAGS_DIST_BUILD" ; } +# - test -z "$c_tests" || $MAKE check CC="$CC" STEMMING_DATA=snowball-data +# - test -z "$PYTHON" || $MAKE check_python python="$PYTHON" STEMMING_DATA=snowball-data +# - test -z "$JAVA" -o -z "$JAVAC" || $MAKE check_java STEMMING_DATA=snowball-data +# - test -z "$MCS" || $MAKE check_csharp MCS="$MCS" STEMMING_DATA=snowball-data +# - test -z "$NODE" || $MAKE check_js STEMMING_DATA=snowball-data +# - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data +# - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data +# - test -z "$GO" || $MAKE check_go STEMMING_DATA=snowball-data +# - test -z "$FPC" || $MAKE check_pascal STEMMING_DATA=snowball-data +# - test -z "$gprbuild" || $MAKE check_ada STEMMING_DATA=snowball-data + +#before_install: +# # Try to check out a branch of the same name from the snowball-data repo +# # sibling of this snowball repo, so that PRs requiring changes to both can be +# # CI tested easily. +# # +# # If that fails, just use the standard snowball-data repo's default branch. +# - GH_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} +# - GH_REPO_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG} +# - GH_REPO_URL=https://github.com/${GH_REPO_SLUG%%/*}/snowball-data.git +# - echo "Trying branch $GH_BRANCH from $GH_REPO_URL" +# - git clone --depth=1 -b "$GH_BRANCH" "$GH_REPO_URL" || git clone --depth=1 https://github.com/snowballstem/snowball-data.git +# +#script: +# # Ensure CC is set for building the compiler in non-C builds. +# - test -n "$CC" || export CC=gcc +# - $MAKE CC="$CC" +# - test -z "$CFLAGS_DIST_BUILD" || { pip install setuptools && $MAKE dist && mkdir tmp && cd tmp && tar xf ../dist/libstemmer_c-*.tar.gz && cd libstemmer_c-* && $MAKE CFLAGS="$CFLAGS_DIST_BUILD" ; } +# - test -z "$c_tests" || $MAKE check CC="$CC" STEMMING_DATA=snowball-data +# - test -z "$PYTHON" || $MAKE check_python python="$PYTHON" STEMMING_DATA=snowball-data +# - test -z "$JAVA" -o -z "$JAVAC" || $MAKE check_java STEMMING_DATA=snowball-data +# - test -z "$MCS" || $MAKE check_csharp MCS="$MCS" STEMMING_DATA=snowball-data +# - test -z "$NODE" || $MAKE check_js STEMMING_DATA=snowball-data +# - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data +# - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data +# - test -z "$GO" || $MAKE check_go STEMMING_DATA=snowball-data +# - test -z "$FPC" || $MAKE check_pascal STEMMING_DATA=snowball-data +# - test -z "$gprbuild" || $MAKE check_ada STEMMING_DATA=snowball-data diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27896f3f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,112 +0,0 @@ -language: minimal -arch: arm64 -dist: xenial -env: - global: MAKE=make -matrix: - include: - - name: "C distribution build" - language: c - dist: focal - compiler: gcc - env: CFLAGS_DIST_BUILD='-O2 -Wall -W -std=c90 -Wdeclaration-after-statement -Werror' - - name: "C distribution build (clang)" - language: c - dist: focal - compiler: clang - env: CFLAGS_DIST_BUILD='-O2 -Wall -W -std=c90 -Wdeclaration-after-statement -Werror' - - language: c - compiler: gcc - env: c_tests=y CFLAGS='-O2 -Wall -W -std=c99 -Werror' - - language: c - compiler: clang - env: c_tests=y CFLAGS='-O2 -Wall -W -std=c99 -Werror' - - language: java - env: JAVA=java JAVAC=javac - - language: go - go: "1.8" - env: GO=go - - language: go - dist: bionic - go: "1.17" - env: GO=go - - language: node_js - node_js: "node" - env: NODE=node - dist: focal # seems to be needed for working node - - language: rust - rust: - - stable - - beta - dist: bionic - env: RUST=rust - - language: csharp - arch: amd64 # csharp doesn't seem to work on arm64 - env: MCS=mcs - dist: bionic - - name: Pascal - env: FPC=fpc - dist: bionic - addons: - apt: - packages: - - fpc - # The pure Python versions run slowly so we need to thin the testdata - # for languages such as Arabic where there's a lot, or else the build - # hits the travis time limit. With pypy, it's enough faster than we - # can run the full tests. - - language: python - python: "3.9" - env: PYTHON=python THIN_FACTOR=10 - - language: python - python: "3.7" - env: PYTHON=python THIN_FACTOR=10 - - language: python - python: "3.6" - env: PYTHON=python THIN_FACTOR=10 - - language: python - python: "pypy3.7-7.3.5" - env: PYTHON=python - dist: bionic - - name: "Ada" - env: gprbuild=gprbuild - dist: bionic - addons: - apt: - packages: - - gnat - - gprbuild - - os: windows - language: c - env: c_tests=y MAKE=mingw32-make - - os: windows - language: go - env: GO=go MAKE=mingw32-make - -before_install: - # Try to check out a branch of the same name from the snowball-data repo - # sibling of this snowball repo, so that PRs requiring changes to both can be - # CI tested easily. - # - # If that fails, just use the standard snowball-data repo's default branch. - - GH_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} - - GH_REPO_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG} - - GH_REPO_URL=https://github.com/${GH_REPO_SLUG%%/*}/snowball-data.git - - echo "Trying branch $GH_BRANCH from $GH_REPO_URL" - - git clone --depth=1 -b "$GH_BRANCH" "$GH_REPO_URL" || git clone --depth=1 https://github.com/snowballstem/snowball-data.git - -script: - # Ensure CC is set for building the compiler in non-C builds. - - test -n "$CC" || export CC=gcc - - $MAKE CC="$CC" - - test -z "$CFLAGS_DIST_BUILD" || { pip install setuptools && $MAKE dist && mkdir tmp && cd tmp && tar xf ../dist/libstemmer_c-*.tar.gz && cd libstemmer_c-* && $MAKE CFLAGS="$CFLAGS_DIST_BUILD" ; } - - test -z "$c_tests" || $MAKE check CC="$CC" STEMMING_DATA=snowball-data - - test -z "$PYTHON" || $MAKE check_python python="$PYTHON" STEMMING_DATA=snowball-data - - test -z "$JAVA" -o -z "$JAVAC" || $MAKE check_java STEMMING_DATA=snowball-data - - test -z "$MCS" || $MAKE check_csharp MCS="$MCS" STEMMING_DATA=snowball-data - - test -z "$NODE" || $MAKE check_js STEMMING_DATA=snowball-data - - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data - - test -z "$RUST" || $MAKE check_rust STEMMING_DATA=snowball-data - - test -z "$GO" || $MAKE check_go STEMMING_DATA=snowball-data - - test -z "$FPC" || $MAKE check_pascal STEMMING_DATA=snowball-data - - test -z "$gprbuild" || $MAKE check_ada STEMMING_DATA=snowball-data