File: go_test.yml

package info (click to toggle)
golang-github-transparency-dev-tessera 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,612 kB
  • sloc: sql: 33; sh: 17; makefile: 12
file content (70 lines) | stat: -rw-r--r-- 1,982 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Test Go

on: [push, pull_request]

permissions:
  contents: read

jobs:
  test:
    strategy:
      matrix:
        go-version: [ '1.24.x', '1.25.x' ]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}

    steps:
      - name: Fetch repo
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false

      - name: Install Go
        uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
        with:
          go-version: ${{ matrix.go-version }}

      - name: Run tests
        run: go test -v -race ./...

  test-mysql:
    env:
      DB_DATABASE: test_tessera
      DB_USER: root
      DB_PASSWORD: root

    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false
      - name: Start MySQL
        run: |
          sudo /etc/init.d/mysql start
          mysql -e "CREATE DATABASE IF NOT EXISTS $DB_DATABASE;" -u$DB_USER -p$DB_PASSWORD
      - name: Test with Go
        # Parallel tests are disabled for the MySQL test database to always be in a known state.
        run: go test -p=1 -v -race ./storage/mysql/... -is_mysql_test_optional=true

  test-aws-mysql:
    env:
      DB_DATABASE: test_tessera
      DB_USER: root
      DB_PASSWORD: root

    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false
      - name: Start MySQL
        run: |
          sudo /etc/init.d/mysql start
          mysql -e "CREATE DATABASE IF NOT EXISTS $DB_DATABASE;" -u$DB_USER -p$DB_PASSWORD
      - name: Test with Go
        # Parallel tests are disabled for the MySQL test database to always be in a known state.
        run: go test -p=1 -v -race ./storage/aws/... -is_mysql_test_optional=false