From c26a7296ed7f93a7f0952bff8075f2d8876e419c Mon Sep 17 00:00:00 2001 From: Emin Muhammadi Date: Tue, 7 Jun 2022 22:39:17 +0200 Subject: [PATCH] Pipeline fixed --- .github/FUNDING.yml | 1 + .github/workflows/pipeline.yaml | 94 +++++++++++---------------------- 2 files changed, 32 insertions(+), 63 deletions(-) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..46e5f5f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: eminmuhammadi \ No newline at end of file diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index cd5b019..a24cb70 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -1,71 +1,39 @@ -name: "DaVinci Development Pipeline" - -on: - push: - branches: ["master"] - pull_request: - branches: ["master"] - +on: [push, pull_request] +name: Test jobs: - build: - runs-on: ubuntu-latest + test: + strategy: + matrix: + go-version: [1.17.x, 1.18.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.16 + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@v3 + - run: go test ./... - - name: Verify dependencies - run: go mod verify - - - name: Install - run: go install - - - name: Build - run: go build -v ./... - - - name: Run go vet - run: go vet ./... - - lint: + test-cache: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.16 - - - name: Verify dependencies - run: go mod verify - - - name: Install - run: go install - - - name: Install golint - run: go install golang.org/x/lint/golint@latest - - - name: Run golint - run: golint ./... - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 + go-version: 1.18.x + - uses: actions/checkout@v3 + - uses: actions/cache@v2 with: - go-version: 1.16 - - - name: Verify dependencies - run: go mod verify - - - name: Install - run: go install - - - name: Run tests - run: go test -race -vet=off ./... + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- + - run: go test ./...