diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0340d27c..61f8dc543 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,18 +15,18 @@ on: jobs: golangci: name: lint - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.48.0 args: --timeout=10m --skip-dirs=fix42,fix44 --exclude="Error return value of .(store.cache.*|suite.msgStore.*). is not checke" build: name: build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: go: [1.16.x, 1.18.x] @@ -42,15 +42,32 @@ jobs: # - FIX_TEST=fix50sp2 steps: - name: Setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: Check out source - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: mod download + run: go mod download + - name: Run Mongo - run: docker run -d -p 27017:27017 mongo + run: docker compose up -d mongo + - name: Test env: GO111MODULE: "on" - MONGODB_TEST_CXN: "localhost" + MONGODB_TEST_CXN: "mongodb://localhost:27017/" run: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi + + - name: after test + if: always() + run: docker compose down diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 940369a5d..66b14c466 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,11 +39,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..b05283994 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +version: '3.8' + +services: + mongo: + image: mongo:5 + ports: + - "27017:27017"