diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..2412801dd2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,201 @@ +name: CI +on: + push: + branches: + - master + pull_request: +jobs: + linux: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + arch: [x86_64] + include: + - arch: x86_64 + suffix: amd64 + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + submodules: true + - name: Install packages + run: | + sudo apt-get update -qq + sudo apt-get install -y \ + automake \ + autoconf \ + bison \ + flex \ + gdb \ + python3 + - name: Build + env: + CC: clang -arch ${{ matrix.arch }} + run: | + autoreconf -fi + ./configure --disable-dependency-tracking \ + --disable-silent-rules \ + --disable-maintainer-mode \ + --disable-valgrind \ + --with-oniguruma=builtin \ + YACC="$(which bison) -y" + make + make dist + - name: Test + env: + CC: clang -arch ${{ matrix.arch }} + run: | + make check + - name: Upload Test Logs + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test-logs-linux-${{ matrix.arch }} + retention-days: 7 + path: | + test-suite.log + tests/*.log + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: jq-linux-${{ matrix.suffix }} + if-no-files-found: error + retention-days: 7 + path: | + jq + macos: + runs-on: macos-13 + strategy: + fail-fast: false + matrix: + arch: [x86_64] + include: + - arch: x86_64 + suffix: amd64 + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + submodules: true + - name: Install packages + run: | + brew update + brew install \ + autoconf \ + automake \ + libtool \ + flex \ + bison + sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac + - name: Build + env: + CC: clang -arch ${{ matrix.arch }} + run: | + autoreconf -fi + ./configure --disable-dependency-tracking \ + --disable-silent-rules \ + --disable-maintainer-mode \ + --disable-valgrind \ + --with-oniguruma=builtin \ + YACC="$(brew --prefix)/opt/bison/bin/bison -y" + make + make dist + - name: Test + env: + CC: clang -arch ${{ matrix.arch }} + run: | + make check + - name: Upload Test Logs + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test-logs-macos-${{ matrix.arch }} + retention-days: 7 + path: | + test-suite.log + tests/*.log + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: jq-macos-${{ matrix.suffix }} + if-no-files-found: error + retention-days: 7 + path: | + jq + windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + arch: [x86_64] + include: + - arch: x86_64 + suffix: win64 + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + submodules: true + - uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + base-devel + git + clang + autoconf + automake + libtool + - name: Build + shell: msys2 {0} + run: | + autoreconf -fi + ./configure --disable-dependency-tracking \ + --disable-silent-rules \ + --disable-maintainer-mode \ + --disable-valgrind \ + --with-oniguruma=builtin \ + --disable-shared \ + --enable-static \ + --enable-all-static + make + make dist + - name: Test + shell: msys2 {0} + run: | + make SUBDIRS= "TESTS=tests/mantest tests/jqtest tests/onigtest tests/base64test" check + - name: Upload Test Logs + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test-logs-windows-${{ matrix.arch }} + retention-days: 7 + path: | + test-suite.log + tests/*.log + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: jq-windows-${{ matrix.suffix }} + if-no-files-found: error + retention-days: 7 + path: | + jq.exe + release: + runs-on: ubuntu-latest + needs: [linux, macos, windows] + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + submodules: true + - name: Merge built artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Upload release + run: | + ls -R artifacts + gh release create v0.0.1 --draft --title "jq version 0.0.1" --generate-notes + gh release upload v0.0.1 artifacts/jq-* diff --git a/Makefile.am b/Makefile.am index 8b5fb7dd65..c86454781f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -217,7 +217,7 @@ EXTRA_DIST = $(DOC_FILES) $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER) \ # README.md is expected in GitHub projects, good stuff in it, so we'll # distribute it and install it with the package in the doc directory. -dist_doc_DATA = README.md COPYING AUTHORS README +dist_doc_DATA = README.md COPYING AUTHORS pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libjq.pc diff --git a/README b/README deleted file mode 120000 index 42061c01a1..0000000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file