Skip to content

Commit

Permalink
ci: simplify workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero committed Dec 24, 2024
1 parent 4088acd commit 1bfafbd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 183 deletions.
43 changes: 0 additions & 43 deletions .docker/Fedora.dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions .docker/Ubuntu.dockerfile

This file was deleted.

23 changes: 1 addition & 22 deletions .github/workflows/code_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,8 @@ jobs:
- name: Build
run: go build -o bin/algorun *.go

- name: Install Algod
run: ./bin/algorun install

- name: Wait for the server to start
run: npx wait-on tcp:8080

- name: Unit Tests
run: make unit

- name: Kill docker
run: docker compose down

- name: Start Integration
run: docker compose -f docker-compose.integration.yaml up -d

- name: Wait for mount
run: npx wait-on ./coverage/int/fedora/40 ./coverage/int/ubuntu/24.04/

- name: Integration tests
run: make integration

- name: Combine coverage
run: make combine-coverage
run: make test

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/node_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
go-version: 1.22
- name: Run Ubuntu commands
run: |
go build .
export GOCOVERDIR=$(pwd)/coverage
mkdir -p $GOCOVERDIR
go build -cover .
./algorun-tui install
systemctl status algorand.service
export TOKEN=$(cat /var/lib/algorand/algod.admin.token)
Expand All @@ -32,6 +34,12 @@ jobs:
./algorun-tui upgrade
./algorun-tui stop
./algorun-tui uninstall
go tool covdata textfmt -i=$GOCOVERDIR -o coverage.txt
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

macos:
runs-on: macos-latest
Expand All @@ -44,7 +52,9 @@ jobs:

- name: Run MacOs commands
run: |
go build .
export GOCOVERDIR=$(pwd)/coverage
mkdir -p $GOCOVERDIR
go build -cover .
./algorun-tui install
sudo launchctl print system/com.algorand.algod
sleep 5
Expand All @@ -54,3 +64,9 @@ jobs:
./algorun-tui upgrade
./algorun-tui stop
./algorun-tui uninstall
go tool covdata textfmt -i=$GOCOVERDIR -o coverage.txt
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
build:
CGO_ENABLED=0 go build -o bin/algorun *.go
CGO_ENABLED=0 go build -o bin/algorun .
test:
go test -coverpkg=./... -covermode=atomic ./...
go test -coverprofile=coverage.out -coverpkg=./... -covermode=atomic ./...
generate:
oapi-codegen -config generate.yaml https://raw.githubusercontent.com/algorand/go-algorand/v3.26.0-stable/daemon/algod/api/algod.oas3.yml
unit:
mkdir -p $(CURDIR)/coverage/unit && go test -cover ./... -args -test.gocoverdir=$(CURDIR)/coverage/unit
integration:
for service in $(shell docker compose -f docker-compose.integration.yaml ps --services) ; do \
docker compose exec -it "$$service" ansible-playbook --connection=local /root/playbook.yaml ; \
done
combine-coverage:
go tool covdata textfmt -i=./coverage/unit,./coverage/int/ubuntu/24.04,./coverage/int/fedora/40 -o coverage.txt && sed -i 2,3d coverage.txt
oapi-codegen -config generate.yaml https://raw.githubusercontent.com/algorand/go-algorand/v3.26.0-stable/daemon/algod/api/algod.oas3.yml
58 changes: 0 additions & 58 deletions docker-compose.integration.yaml

This file was deleted.

0 comments on commit 1bfafbd

Please sign in to comment.