From d02da4d26ca0fb22fec531fe763f443c5c3c7aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Jane=C5=BE?= Date: Wed, 4 Jan 2023 10:49:44 +0100 Subject: [PATCH] github: Add ci-tests GitHub Actions workflow --- .github/workflows/ci-tests.yml | 42 ++++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/ci-tests.yml diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 00000000..52d4e9e9 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,42 @@ +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. +name: ci-tests + +# Trigger the workflow when: +on: + # A push occurs to one of the matched branches. + push: + branches: + - master + - stable/* + # Or when a pull request event occurs for a pull request against one of the + # matched branches. + pull_request: + branches: + - master + - stable/* + +jobs: + tests: + # NOTE: This name appears in GitHub's Checks API. + name: tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Go 1.17 + uses: actions/setup-go@v3 + with: + go-version: "1.17.x" + - name: Cache Go dependencies + uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Build code + run: | + make build + - name: Run tests + run: | + make test diff --git a/README.md b/README.md index ffc9c23d..11af1d65 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Oasis CLI +[![CI tests status][github-ci-tests-badge]][github-ci-tests-link] [![CI lint status][github-ci-lint-badge]][github-ci-lint-link] +[github-ci-tests-badge]: https://github.com/oasisprotocol/cli/workflows/ci-tests/badge.svg +[github-ci-tests-link]: https://github.com/oasisprotocol/cli/actions?query=workflow:ci-tests+branch:master [github-ci-lint-badge]: https://github.com/oasisprotocol/cli/workflows/ci-lint/badge.svg [github-ci-lint-link]: https://github.com/oasisprotocol/cli/actions?query=workflow:ci-lint+branch:master