From 1cca95e171d664c7df8201c91898a0f8032d1e91 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 24 Feb 2024 19:54:09 +0100 Subject: [PATCH] chore: add test workflow on Linux --- .github/workflows/tests.yml | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..c8febb4e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,71 @@ +name: Tests + +on: + push: + branches: + - main + - ldez-ci + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + + test-linux: + name: Test on Linux + runs-on: ubuntu-latest + env: + GO_VERSION: oldstable + steps: + + - name: Setup /etc/hosts + run: | + echo "127.0.0.1 example.letsencrypt.org" | sudo tee -a /etc/hosts + echo "127.0.0.1 elpmaxe.letsencrypt.org" | sudo tee -a /etc/hosts + + # https://github.com/marketplace/actions/checkout + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # https://github.com/marketplace/actions/setup-go-environment + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: apt install + run: sudo apt-get install snapd python3-acme python3-josepy + + - name: snap install + run: sudo snap install core && sudo snap refresh core + + - name: snap install certbot + run: sudo snap install --classic certbot && sudo ln -s /snap/bin/certbot /usr/bin/certbot + + - name: go install tools + run: go install golang.org/x/tools/cmd/cover@latest + + - name: go install goveralls + run: go install github.com/mattn/goveralls@latest + + - name: go install + run: go install -v -race ./... + + - name: launch pebble + run: GORACE="halt_on_error=1" PEBBLE_WFE_NONCEREJECT=0 pebble & + + # Run project unit tests (with the race detector enabled and atomic coverage profile collection) + - name: unittests + run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + +# # Upload collected coverage profile to goveralls +# - name: goveralls +# run: goveralls -coverprofile=coverage.out -service=github + + # Perform a test issuance with chisel2.py + - name: chisel + run: REQUESTS_CA_BUNDLE=./test/certs/pebble.minica.pem python ./test/chisel2.py example.letsencrypt.org elpmaxe.letsencrypt.org