Tests when using GitHub Actions for CI/CD

I have a small Serverless project that is a mix of Go and Python lambdas. I want to configure it for CI/CD using GitHub Actions.

sls test works great on localhost, but when I run that in my GitHub Action I get:

Serverless: Run "serverless" to configure your service for testing.

What sort of configuration does sls test require?

All the other commands in my GHA script to compile and deploy seem to work OK. e.g.

      - name: Compile all Go lambdas
        run: make all
      - name: Install Serverless Framework
        run: npm install -g serverless
      - name: Install NPM dependencies
        run: npm install
      - name: Serverless AWS authentication
        run: sls config credentials --provider aws --key ${{ secrets.AWS_KEY }} --secret ${{ secrets.AWS_SECRET }}
      - name: Serverless tests
        run: sls test # <-- this does not work
      - name: Deploy Lambda functions to dev
        run: sls deploy --stage dev

Alternatively, can I run sls test against a test stage? It seems there is no --stage argument for the test command.

Hey Clark–I’m having the same issue. Did you figure out a solution for this? Thanks!