Skip to content

Commit

Permalink
[ci] Work towards setting up GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
ojwb committed Sep 7, 2023
1 parent b849d3a commit d229119
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 112 deletions.
143 changes: 143 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
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:
build:
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
# - 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
git remote -v
env|sort
GH_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$GITHUB_REF_NAME}
GH_REPO_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-$GITHUB_REPOSITORY}
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 }}
- name: Build
run: |
# Ensure CC is set for building the compiler in non-C builds.
test -n "$CC" || export CC=gcc
test -n "$MAKE" || export MAKE=make
$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
112 changes: 0 additions & 112 deletions .travis.yml

This file was deleted.

0 comments on commit d229119

Please sign in to comment.