diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 335e54e..9bdc8a8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -60,7 +60,7 @@ jobs: # Run go unit tests - name: Unit testing run: | - go test -v + go test -v ./... # Run simulator integration tests - name: Simulator tests run: | @@ -79,7 +79,7 @@ jobs: cache-to: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/minitwitimage:webbuildcache,mode=max - name: Copy docker-compose.yml to server run: scp docker-compose.yml minitwit:/vagrant/docker-compose.yml - + - name: Copy deploy.sh to server run: >- chmod +x tools/deploy.sh && @@ -100,4 +100,4 @@ jobs: repo_token: "${{ secrets.GH_TOKEN }}" automatic_release_tag: "latest" prerelease: false - title: "Automatic release" \ No newline at end of file + title: "Automatic release" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..695a68c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Testing + +on: + pull_request: + branches: + - main + workflow_dispatch: + manual: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.20.x + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + #Checkout repository files + - name: Checkout + uses: actions/checkout@v2 + #Run linter to check if new code follows the style guidelines + - name: lint + run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + # Run go unit tests + - name: Unit testing + run: | + go test -v ./... + # Run simulator integration tests + - name: Simulator tests + run: | + pip install -r ./tools/requirements.txt + pytest ./tools/test_sim_compliance.py