More logs #9
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: Run tests | |
on: | |
pull_request: | |
branches: [ master, main ] | |
push: | |
branches: [ master, main ] | |
env: | |
KAFKA_PEERS: 127.0.0.1:9092 | |
ZOOKEEPER_PEERS: 127.0.0.1:2181 | |
KAFKA_HOSTNAME: 127.0.0.1 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.PKG_WRITER_PAT }} | |
- name: Cache deps | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install deps | |
run: go mod download | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts | |
sudo echo "127.0.0.1 zookeeper" | sudo tee -a /etc/hosts | |
- name: Start containers | |
run: docker-compose up -d | |
- name: Create test topics | |
run: .github/create_topics.sh | |
- name: Run tests | |
run: make test | |
- name: Stop containers | |
if: always() | |
run: docker-compose down |