github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/.github/workflows/testing.yml (about)

     1  name: Testing
     2  
     3  on:
     4    push:
     5      branches: [ master ]
     6    pull_request:
     7      branches: [ master ]
     8  
     9  jobs:
    10    lint:
    11      name: Lint
    12      runs-on: ubuntu-latest
    13      steps:
    14        - name: Check out code
    15          uses: actions/checkout@v2
    16        - name: golangci-lint
    17          uses: golangci/golangci-lint-action@v1
    18          with:
    19            version: v1.30
    20  
    21    test:
    22      name: Test
    23      runs-on: ubuntu-latest
    24      needs: [lint]
    25  
    26      services:
    27        mongo:
    28          image: mongo:3
    29          ports:
    30            - "27017"
    31          options: >-
    32            --health-cmd "mongo localhost:27017/test --quiet --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'"
    33            --health-interval 10s
    34            --health-timeout 5s
    35            --health-retries 5
    36  
    37        upstreams:
    38          image: rodolpheche/wiremock:2.27.0-alpine
    39          ports:
    40            - "8080"
    41  
    42        auth_service:
    43          image: rodolpheche/wiremock:2.27.0-alpine
    44          ports:
    45            - "8080"
    46  
    47      steps:
    48        - name: Set up Go
    49          uses: actions/setup-go@v2
    50        - name: Check out code
    51          uses: actions/checkout@v2
    52        - name: Run unit tests
    53          if: success()
    54          run: make test-unit
    55        - name: Run integration tests
    56          if: success()
    57          run: make test-integration
    58          env:
    59            DYNAMIC_UPSTREAMS_PORT: ${{ job.services.upstreams.ports[8080] }}
    60            DYNAMIC_AUTH_PORT: ${{ job.services.auth_service.ports[8080] }}
    61        - name: Run features tests
    62          if: success()
    63          run: make test-features
    64          env:
    65            DYNAMIC_MONGO_PORT: ${{ job.services.mongo.ports[27017] }}
    66            DYNAMIC_UPSTREAMS_PORT: ${{ job.services.upstreams.ports[8080] }}
    67            DYNAMIC_AUTH_PORT: ${{ job.services.auth_service.ports[8080] }}
    68  
    69        - name: Upload coverage to Codecov
    70          uses: codecov/codecov-action@v1
    71          if: success()
    72          with:
    73            file: ./coverage.txt
    74            fail_ci_if_error: false