Merge pull request #15 from jonesrussell/dependabot/go_modules/github… #203
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: A workflow for Crawler | |
on: push | |
jobs: | |
build: | |
name: Crawler action | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Create .env file | |
run: | | |
echo "REDIS_HOST=localhost" >> .env | |
echo "REDIS_PORT=6379" >> .env | |
echo "REDIS_AUTH=" >> .env | |
echo "REDIS_STREAM=crawler" >> .env | |
echo "REDIS_DB=1" >> .env | |
# Add other environment variables as needed | |
working-directory: ${{ github.workspace }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' # Change to the required Go version | |
check-latest: true | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build | |
run: go build ./... | |
- name: Run Tests | |
run: go test ./... |