author | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-11-20 12:12:17 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-11-20 12:37:12 UTC |
parent | a5f4c45dbe55f06a5d6b3f3e3a8dc843304efd37 |
.github/workflows/tests.yaml | +42 | -0 |
.gitignore | +2 | -0 |
.gitlab-ci.yml | +0 | -59 |
README.md | +1 | -2 |
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..e4ba01d --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,42 @@ +name: "tests" + +on: + push: + branches: [ "master", "next" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master", "next" ] + schedule: + - cron: '41 22 * * 6' + +jobs: + gotests: + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + matrix: + # Oldest supported version, and latest. + go-version: [ '1.15.x', '1.x' ] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + check-latest: true + cache: true + + - run: go test ./... + - run: go test -race ./... + + integration: + needs: gotests + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - name: Build test image + run: | + docker info + docker build -t dnss-test -f tests/Dockerfile . + - name: Run tests + run: docker run --name test1 dnss-test diff --git a/.gitignore b/.gitignore index 3d18e26..6ebd1ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .*.swp .* +!.gitignore +!.github # Ignore the resulting binary. dnss diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 2a4362d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Configuration for the GitLab CI. - -stages: - - test - -# Go tests, on various Go versions. -.golang_template: &golang - stage: test - script: - - go test ./... - - go test -race ./... - -golang_1.15: - <<: *golang - image: golang:1.15 # Oldest supported version (for now). - -golang_latest: - <<: *golang - image: golang:latest - - -# Integration test, using the module versions from the repository. -integration_stable: - stage: test - image: docker:stable - services: - - docker:dind - script: - - docker build -t dnss-test -f tests/Dockerfile . - - docker run --name test1 dnss-test - after_script: - - docker cp test1:/go/src/blitiri.com.ar/go/dnss docker-out/ - artifacts: - when: always - expire_in: 1 hour - paths: - - docker-out/ - # The test contacts external services so it can be flaky; retry failures to - # prevent false negatives. - retry: 2 - - -# Integration test, using the latest module versions. -integration_latest: - stage: test - image: docker:stable - services: - - docker:dind - script: - - docker build -t dnss-test --build-arg GO_GET_ARGS="-u=patch" -f tests/Dockerfile . - - docker run --name test1 dnss-test - after_script: - - docker cp test1:/go/src/blitiri.com.ar/go/dnss docker-out/ - artifacts: - when: always - expire_in: 1 hour - paths: - - docker-out/ - retry: 2 diff --git a/README.md b/README.md index 9118ee1..7d3c2fa 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ on laptops and small/home networks. It can also act as a DoH server, in case you want end to end control. - -[![Build Status](https://gitlab.com/albertito/dnss/badges/master/pipeline.svg)](https://gitlab.com/albertito/dnss/-/pipelines) +[![Tests Status](https://img.shields.io/github/checks-status/albertito/dnss/master)](https://github.com/albertito/dnss/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/albertito/dnss)](https://goreportcard.com/report/github.com/albertito/dnss)