From 8a10828c747c775baad959d803c522f579ff44e0 Mon Sep 17 00:00:00 2001 From: Sylvain Gaunet <1552102+sgaunet@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:53:17 +0200 Subject: [PATCH] chore: Add CI workflow for testing --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6db0239 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: build +on: + push: + branches: + - main + tags: + - '!*' # Do not execute on tags + +jobs: + # test: + # strategy: + # matrix: + # platform: [ ubuntu-latest, macOS-latest ] + # golang: [ '1.21.6', '1.20.1' ] + # name: test/golang ${{ matrix.golang }}/${{ matrix.platform }} + # runs-on: ${{ matrix.platform }} + # steps: + # - uses: actions/checkout@master + # - uses: actions/setup-go@v5 + # with: + # go-version: ${{ matrix.golang }} + # - run: go version + # - run: go test ./... + coverage: + # needs: [ test ] + name: coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-go@v5 + with: + go-version: 1.22.4 + # Install test-reporter + - run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - run: chmod +x ./cc-test-reporter + # before build step + - run: ./cc-test-reporter before-build + # RUN TEST HERE + - run: go test . -coverprofile c.out + # after build step + - run: ./cc-test-reporter after-build --prefix=github.com/sgaunet/perplexity-go + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} \ No newline at end of file