Skip to content

Set token permissions for workflows (#115) #101

Set token permissions for workflows (#115)

Set token permissions for workflows (#115) #101

name: Myanmar Tools CI
on:
push:
branches: [ master ]
pull_request:
branches: '*'
permissions:
contents: read
jobs:
# Training Data Project
training:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
java-version: '8'
- name: Training Data
run: |
cd training
mvn compile
mvn test
# Generate-Converter Project
gen-conv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
java-version: '8'
- name: Generate-Converter
run: |
cd genconvert
mvn compile
mvn test
# Check consistency between genconvert and compiled converters
genconvert:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
java-version: '8'
- name: Consistency genconvert vs compiled
run: |
make transcompile
# There should not be any dirty files:
git update-index --refresh
git diff-index HEAD --exit-code
# CPP Client
cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: cpp-check
run: |
sudo apt-get -y install cmake
cd clients/cpp
CXXFLAGS="-w" cmake CMakeLists.txt
make
make test
# Java Client
java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
java-version: '7'
- name: Java client test
run: |
cd clients/java
mvn compile
mvn test
# Ruby Client (minimum Ruby version)
ruby-min-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.0 # minimum supported version
- name: Run Rake tests
run: |
pushd clients/ruby
bundle install
rake test
popd
# Ruby Client (latest Ruby version with jruby)
ruby-latest-jruby:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: jruby-head
- name: Run Rake tests
run: |
pushd clients/ruby
gem install bundler
bundle install
rake test
popd
# PHP Client (minimum PHP version)
php-min-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP with min version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0'
- uses: "ramsey/composer-install@v1"
- run: ./vendor/bin/phpunit --configuration clients/php/phpunit.xml
# PHP Client (latest PHP v7 version)
#
# Note: PHP v8+ not supported. Error output for v8:
#
# phpunit/phpunit[6.0.0, ..., 6.5.14] require php ^7.0 -> your php version (8.0.5) does not satisfy that requirement.
# Root composer.json requires phpunit/phpunit ^6 -> satisfiable by phpunit/phpunit[6.0.0, ..., 6.5.14].
#
php-latest-v7-version:
name: PHP latest v 7.x version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP with the latest version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- uses: "ramsey/composer-install@v1"
- run: ./vendor/bin/phpunit --configuration clients/php/phpunit.xml
# JavaScript Client (latest Node version)
javascript-latest-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '14'
- name: Javascript client test
run: |
cd clients/js
npm version
npm ci
npm run test
# JavaScript Client (lower npm version)
# Note: even older Node.js versions might be allowed, but the
# test tooling requires more recent versions.
javascript-older-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '6.x'
- name: Javascript client test
run: |
npm install -g npm@5.7.1
cd clients/js
npm version
npm ci
npm run test
# Python Client
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Python client test
run: |
cd clients/python
python setup.py install
python -m unittest
# Go Client
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.13.1'
- run: go install github.com/go-bindata/go-bindata/...@latest
- run: cd clients/go && go generate && go test
# Swift Client on macOS
swift:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Configure XCode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
- run: make client-swift-test
# Dart Client(Flutter)
dart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.5.3'
- name: Install dependencies
run: |
cd clients/dart
flutter pub get
- name: Run dart tests
run: |
cd clients/dart
flutter test
# C# Client on Ubuntu
C_Sharp_Ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'
- name: Install dependencies
run: |
cd clients/c#
dotnet restore
- name: Run tests
run: |
cd clients/c#
dotnet test
# C# Client on Windows
C_Sharp_Windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'
- name: Install dependencies
run: |
cd clients/c#
dotnet restore
- name: Run tests
run: |
cd clients/c#
dotnet test