jx/.gitea/workflows/test.yaml
Matthew Rich 35ae742615
Some checks failed
Lint / golangci-lint (push) Successful in 9m45s
Declarative Tests / test (push) Successful in 20s
Declarative Tests / build (push) Successful in 1m26s
Declarative Tests / build-focal (push) Failing after 23s
test dist builds
2024-05-28 15:42:29 -07:00

128 lines
4.1 KiB
YAML

name: Declarative Tests
run-name: ${{ gitea.actor }} testing
on:
- push
- workflow_dispatch
- issue_comment
jobs:
test:
runs-on: ubuntu-latest
container:
image: registry.cv.mazarbul.net/declarative/build-golang:1.22.1-alpine-x86_64
env:
GOPATH: /
SSH_AUTH_SOCK: /tmp/ssh.sock
ENVIRONMENT: dev
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/gitconfig:/etc/gitconfig:ro"
- "/${{ env.SSH_AUTH_SOCK }}:/tmp/ssh.sock"
- "/opt/gitea/act_runner/.ssh/known_hosts:/root/.ssh/known_hosts"
- "/opt/gitea/act_runner/.gitconfig:/root/.gitconfig:ro"
- "/opt/gitea/act_runner/.git-credentials:/root/.git-credentials:ro"
- "/etc/ssl/certs:/etc/ssl/certs:ro"
options: --cpus 10
steps:
- run: apk add --no-cache nodejs
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "The workflow is now ready to test your code on the runner."
- name: Run tests
run: |
go test -coverprofile=artifacts/coverage.profile ./...
- name: Run build
run: |
make build
- name: cli tests
run: |
go test
- run: echo "This job's status is ${{ job.status }}."
- run: echo "This job's status is ${{ job.status }}."
- name: coverage report
run: |
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: artifacts/code-coverage.html
- name: Archive binary
uses: actions/upload-artifact@v3
with:
name: jx
path: jx
- run: echo "This job's status is ${{ job.status }}."
build:
runs-on: ubuntu-latest
container:
image: fedora:latest
env:
GOPATH: /
SSH_AUTH_SOCK: /tmp/ssh.sock
ENVIRONMENT: dev
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/gitconfig:/etc/gitconfig:ro"
- "/${{ env.SSH_AUTH_SOCK }}:/tmp/ssh.sock"
- "/opt/gitea/act_runner/.ssh/known_hosts:/root/.ssh/known_hosts"
- "/opt/gitea/act_runner/.gitconfig:/root/.gitconfig:ro"
- "/opt/gitea/act_runner/.git-credentials:/root/.git-credentials:ro"
- "/etc/ssl/certs:/etc/ssl/certs:ro"
options: --cpus 10
steps:
- run: dnf install -y nodejs git
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: dnf install -y dnf-plugins-core rpm-build rpmdevtools
- run: dnf builddep -y build/jx.spec
- name: Run build
run: |
make rpm
- name: Archive binary
uses: actions/upload-artifact@v3
with:
name: jx
path: jx
- uses: actions/upload-artifact@v3
with:
path: "/root/rpmbuild/**/*.rpm"
- run: echo "This job's status is ${{ job.status }}."
build-focal:
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: ubuntu:focal
env:
GOPATH: /
SSH_AUTH_SOCK: /tmp/ssh.sock
ENVIRONMENT: dev
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/gitconfig:/etc/gitconfig:ro"
- "/${{ env.SSH_AUTH_SOCK }}:/tmp/ssh.sock"
- "/opt/gitea/act_runner/.ssh/known_hosts:/root/.ssh/known_hosts"
- "/opt/gitea/act_runner/.gitconfig:/root/.gitconfig:ro"
- "/opt/gitea/act_runner/.git-credentials:/root/.git-credentials:ro"
- "/etc/ssl/certs:/etc/ssl/certs:ro"
options: --cpus 10
steps:
- run: apt-get -y update
- run: apt-get install -y nodejs git
- uses: actions/checkout@v3
- run: make build-deps
- run: make build
- run: make deb
- uses: actions/upload-artifact@v3
with:
name: "ubuntu/focal/jx"
path: "jx"