Adds another shunt to tolerate NMDC testing flakiness. (#193) #462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: autotest_prs | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Setting up Go 1.21 | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ^1.21 | |
| id: go | |
| - name: Checking out DTS | |
| uses: actions/checkout@v4 | |
| - name: Vetting DTS | |
| run: go vet -v ./... | |
| - name: Static Analysis | |
| run: | | |
| go install honnef.co/go/tools/cmd/staticcheck@latest | |
| staticcheck ./... | |
| - name: Set up MinIO | |
| uses: infleet/[email protected] | |
| with: | |
| port: "9000" | |
| version: "latest" | |
| username: "minioadmin" | |
| password: "minioadmin" | |
| - name: Building DTS | |
| run: go build -v ./... | |
| - name: Testing DTS against real services | |
| id: test | |
| shell: bash | |
| env: | |
| DTS_KBASE_DEV_TOKEN: ${{ secrets.DTS_KBASE_DEV_TOKEN }} | |
| DTS_KBASE_TEST_ORCID: ${{ secrets.DTS_KBASE_TEST_ORCID }} | |
| DTS_KBASE_TEST_USER: ${{ secrets.DTS_KBASE_TEST_USER }} | |
| DTS_GLOBUS_CLIENT_ID: ${{ secrets.DTS_GLOBUS_CLIENT_ID }} | |
| DTS_GLOBUS_CLIENT_SECRET: ${{ secrets.DTS_GLOBUS_CLIENT_SECRET }} | |
| DTS_GLOBUS_TEST_ENDPOINT: ${{ secrets.DTS_GLOBUS_TEST_ENDPOINT }} | |
| DTS_JDP_SECRET: ${{ secrets.DTS_JDP_SECRET }} | |
| DTS_NMDC_USER: ${{ secrets.DTS_NMDC_USER }} | |
| DTS_NMDC_PASSWORD: ${{ secrets.DTS_NMDC_PASSWORD }} | |
| run: | | |
| PACKAGES=$(go list ./... | grep -v /integration) | |
| go test -v $PACKAGES -coverprofile=coverage.out -covermode=atomic | |
| continue-on-error: true # load coverage even if tests fail | |
| - name: Testing DTS against mock services | |
| id: test-mock | |
| shell: bash | |
| env: | |
| DTS_TEST_WITH_MOCK_SERVICES: true | |
| run: | | |
| go test -v ./... -coverprofile=coverage_mock.out -covermode=atomic | |
| continue-on-error: true # load coverage even if tests fail | |
| - name: Run AWS example script # example script for using the aws go sdk | |
| shell: bash | |
| working-directory: ./etc/aws_client | |
| run: | | |
| go run ./... | |
| - name: Uploading code coverage report to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.out,coverage_mock.out | |
| - name: Fail if tests failed | |
| if: steps.test.outcome == 'failure' || steps.test-mock.outcome == 'failure' | |
| run: exit 1 |