From 0a961d8e07077cdbfcede0fa25ea6c979452fe41 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 7 Feb 2025 20:40:15 +0000 Subject: [PATCH] ci: e2e flow --- .github/workflows/lint.yml | 29 ------------------- .github/workflows/test.yml | 59 +++++++++++++++++++++++++++++++------- Makefile | 5 +++- 3 files changed, 53 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index ab12405e..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: lint -on: - push: - branches: ["main"] - pull_request: - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.23.x] - os: [ubuntu-latest] - fail-fast: false - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Go imports lint - uses: zjkmxy/golang-github-actions@v1.1.3 - with: - run: imports - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88d23464..0141831f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,23 +6,62 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.23.x] - os: [ubuntu-latest] - fail-fast: false + runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} + go-version: 1.23.x - name: Checkout repository uses: actions/checkout@v4 + - name: Build + run: make + - name: Test - run: go test ./... - env: - CGO_ENABLED: 0 + run: make test + + - uses: actions/upload-artifact@v4 + with: + name: ndnd + path: ndnd + + lint: + runs-on: ubuntu-latest + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.x + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Go imports lint + uses: zjkmxy/golang-github-actions@v1.1.3 + with: + run: imports + token: ${{ secrets.GITHUB_TOKEN }} + + e2e: + needs: test + runs-on: ubuntu-latest + + container: + image: ghcr.io/named-data/mini-ndn:master + options: --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: ndnd + path: /bin/ndnd + + - name: Run e2e tests + run: make e2e diff --git a/Makefile b/Makefile index 77431413..a195b3f3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION= $(shell git describe --tags --always --dirty) STD_PACKAGE = github.com/named-data/ndnd/std -.PHONY: all install clean test coverage +.PHONY: all install clean test coverage e2e all: ndnd @@ -25,6 +25,9 @@ clean-gen: test: CGO_ENABLED=0 go test ./... -coverprofile=coverage.out +e2e: + python3 e2e/runner.py + coverage: go tool cover -html=coverage.out