diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2d22da4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.14', '1.13' ] + name: Build and test on go ${{ matrix.go }} + steps: + + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v2.0.3 + with: + go-version: ${{ matrix.go }} + id: go + + - name: Check out code + uses: actions/checkout@v2.2.0 + + - name: Install ninja + run: | + mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin + wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip + unzip ninja-linux.zip + rm ninja-linux.zip + echo "::add-path::${GITHUB_WORKSPACE}/ninja-bin" + + - name: Run gofmt + run: ./.gofmt.sh + + - name: Test + run: go test ./... + + - name: Test with race detector + run: go test -race -short ./... + + - run: ./tests/test.sh + - run: ./tests/test_tree_tests.sh + - run: ./tests/test_tree_tests.sh -t diff --git a/.travis.gofmt.sh b/.gofmt.sh similarity index 100% rename from .travis.gofmt.sh rename to .gofmt.sh diff --git a/.travis.fix-fork.sh b/.travis.fix-fork.sh deleted file mode 100755 index af26716..0000000 --- a/.travis.fix-fork.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if echo $TRAVIS_BUILD_DIR | grep -vq "github.com/google/blueprint$" ; then - cd ../.. - mkdir -p google - mv $TRAVIS_BUILD_DIR google/blueprint - cd google/blueprint - export TRAVIS_BUILD_DIR=$PWD -fi diff --git a/.travis.install-ninja.sh b/.travis.install-ninja.sh deleted file mode 100755 index 5309945..0000000 --- a/.travis.install-ninja.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Version of ninja to build -- can be any git revision -VERSION="v1.7.1" - -set -ev - -SCRIPT_HASH=$(sha1sum ${BASH_SOURCE[0]} | awk '{print $1}') - -cd ~ -if [[ -d ninjabin && "$SCRIPT_HASH" == "$(cat ninjabin/script_hash)" ]]; then - exit 0 -fi - -git clone https://github.com/martine/ninja -cd ninja -./configure.py --bootstrap - -mkdir -p ../ninjabin -rm -f ../ninjabin/ninja -echo -n $SCRIPT_HASH >../ninjabin/script_hash -mv ninja ../ninjabin/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 706e469..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: go - -go: - - "1.10" - - "1.11" - - "1.12" - - "1.13" - -cache: - directories: - - $HOME/ninjabin - -install: - - ./.travis.install-ninja.sh - - export PATH=$PATH:~/ninjabin - -before_script: - - source .travis.fix-fork.sh - -script: - - export GOROOT=$(go env GOROOT) - - ./.travis.gofmt.sh - - go test ./... - - go test -race -short ./... - - ./tests/test.sh - - ./tests/test_tree_tests.sh - - ./tests/test_tree_tests.sh -t diff --git a/README.md b/README.md index 5370c05..31e832c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Blueprint Build System ====================== -[![Build Status](https://travis-ci.org/google/blueprint.svg?branch=master)](https://travis-ci.org/google/blueprint) +[![build](https://github.com/danw/blueprint/workflows/build/badge.svg)](https://github.com/google/blueprint/actions) Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a