ci-pr-build-test.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: Building and test for PR
  2. on:
  3. pull_request:
  4. types: [opened, synchronize, reopened]
  5. jobs:
  6. build_and_test:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v4
  10. - name: Setup Go
  11. uses: actions/setup-go@v4
  12. with:
  13. go-version: '1.25'
  14. - name: Install check tools
  15. shell: bash
  16. run: |
  17. set -o xtrace
  18. git clone --branch master --depth 4 https://github.com/yunionio/tools && cd tools
  19. go build ./cmd/goimports && sudo cp goimports /usr/bin/ && cd .. && rm -rf tools
  20. git clone --depth 4 https://github.com/yousong/y18n && cd y18n
  21. go build . && sudo cp y18n /usr/bin && cd .. && rm -rf y18n
  22. - name: Test and build
  23. shell: bash
  24. run: |
  25. set -o xtrace
  26. export GO111MODULE=on
  27. make -j3 check
  28. make test
  29. targets="$(find cmd -mindepth 1 -maxdepth 1 -type d | grep -v cmd/host-image | grep -v torrent)"
  30. echo $targets | tr ' ' '\n'
  31. make $targets
  32. ls -lh _output/bin