diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-07-24 12:00:50 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-11-20 10:40:13 +0100 |
| commit | 257c743f8dae1fe3c6a1d899da852b7b61c54986 (patch) | |
| tree | 39374cd046e231a26ca0691a3328262e5e4b0c4e /.forgejo | |
| parent | c531015db65eb3e71b1fadfe51f9c107a7bf5216 (diff) | |
CI: Convert to forgejo
Diffstat (limited to '.forgejo')
| -rw-r--r-- | .forgejo/workflows/test.yml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..fa3ac07 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,42 @@ +env: + BUILD_DEPENDENCIES: apt-transport-https curl git iproute2 lsb-release make wget + GOCILINT_VERSION: 1.62.0 +on: [ push ] + +jobs: + test: + runs-on: docker + container: + image: debian:latest + steps: + - name: Install OS Dependencies + run: | + apt-get update + apt-get install --yes $BUILD_DEPENDENCIES + - name: Enable Go Backports + run: | + wget -O /usr/share/keyrings/go+repo@tuxed.net.gpg https://repo.tuxed.net/golang/v1/deb/go+repo@tuxed.net.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/go+repo@tuxed.net.gpg] https://repo.tuxed.net/golang/v1/deb $(lsb_release -c -s) main" > /etc/apt/sources.list.d/golang_v1.list + apt-get update + apt-get install --yes golang-go + - name: Install linter + run: | + wget -O lint.deb https://github.com/golangci/golangci-lint/releases/download/v$GOCILINT_VERSION/golangci-lint-$GOCILINT_VERSION-linux-amd64.deb + dpkg -i lint.deb + rm lint.deb + - name: Clone Repository + run: | + mkdir app + git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} app + - name: Download Go deps + run: | + cd app + go get ./... + - name: Test Go + run: | + cd app + unshare -r -n bash -c "ip link set lo up && make test" + - name: Lint + run: | + cd app + make lint |
