| 1 | name: Tests |
| 2 | on: |
| 3 | push: |
| 4 | branches: [ "main" ] |
| 5 | pull_request: |
| 6 | branches: [ "main" ] |
| 7 | jobs: |
| 8 | legacy-tests: |
| 9 | runs-on: ubuntu-18.04 |
| 10 | env: |
| 11 | GOPATH: ${{ github.workspace }} |
| 12 | steps: |
| 13 | - name: Set up Go 1.16 |
| 14 | uses: actions/setup-go@v2 |
| 15 | with: |
| 16 | go-version: 1.16 |
| 17 | - name: Checkout code |
| 18 | uses: actions/checkout@v2 |
| 19 | with: |
| 20 | path: src/github.com/canonical/go-sp800.90a-drbg |
| 21 | - name: Cache Go dependencies |
| 22 | id: cache-go-modules |
| 23 | uses: actions/cache@v2 |
| 24 | with: |
| 25 | path: ${{ github.workspace }}/pkg/mod |
| 26 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 27 | restore-keys: | |
| 28 | ${{ runner.os }}-go- |
| 29 | - name: Vendor Go dependencies |
| 30 | run: cd ${{ github.workspace }}/src/github.com/canonical/go-sp800.90a-drbg && go mod vendor |
| 31 | - name: Set up Go 1.9 |
| 32 | uses: actions/setup-go@v2 |
| 33 | with: |
| 34 | go-version: 1.9 |
| 35 | - name: Build |
| 36 | run: go build -v github.com/canonical/go-sp800.90a-drbg/... |
| 37 | - name: Test |
| 38 | run: go test -v github.com/canonical/go-sp800.90a-drbg/... |
| 39 | tests: |
| 40 | runs-on: ubuntu-18.04 |
| 41 | strategy: |
| 42 | matrix: |
| 43 | goversion: [1.16, 1.15, 1.14, 1.13] |
| 44 | steps: |
| 45 | - name: Set up Go |
| 46 | uses: actions/setup-go@v2 |
| 47 | with: |
| 48 | go-version: ${{ matrix.goversion }} |
| 49 | - name: Checkout code |
| 50 | uses: actions/checkout@v2 |
| 51 | - name: Cache Go dependencies |
| 52 | id: cache-go-modules |
| 53 | uses: actions/cache@v2 |
| 54 | with: |
| 55 | path: ~/go/pkg/mod |
| 56 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 57 | restore-keys: | |
| 58 | ${{ runner.os }}-go- |
| 59 | - name: Build |
| 60 | run: go build -v -mod=readonly ./... |
| 61 | - name: Test |
| 62 | run: go test -v -mod=readonly ./... |
| 63 | - name: Go vet |
| 64 | run: go vet ./... |