diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b351548..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: 2 - -jobs: - "golang-1.24": - docker: - - image: cimg/go:1.24 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.24-external-libzstd": - docker: - - image: cimg/go:1.24 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.25": - docker: - - image: cimg/go:1.25 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.25-external-libzstd": - docker: - - image: cimg/go:1.25 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.26": - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.26-external-libzstd": - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-efence": - resource_class: xlarge - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr GODEBUG=efence=1 go test -v' - "golang-efence-external-libzstd": - resource_class: xlarge - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build -tags external_libzstd' - - run: 'PAYLOAD=`pwd`/mr GODEBUG=efence=1 go test -tags external_libzstd -v' - "golang-i386": - docker: - - image: 32bit/ubuntu:16.04 - steps: - - checkout - - run: 'linux32 --32bit i386 ./travis_test_32.sh' - -workflows: - version: 2 - build: - jobs: - - "golang-1.24" - - "golang-1.24-external-libzstd" - - "golang-1.25" - - "golang-1.25-external-libzstd" - - "golang-1.26" - - "golang-1.26-external-libzstd" - - "golang-efence" - - "golang-efence-external-libzstd" - - "golang-i386" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8cdfcd2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,118 @@ +name: CI + +on: + push: + branches: [main, "1.x"] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build-test: + name: golang-${{ matrix.go-version }}${{ matrix.external-libzstd && '-external-libzstd' || '' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: ["1.24", "1.25", "1.26"] + external-libzstd: [false, true] + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: ${{ matrix.go-version }} + - name: Install libzstd-dev + if: ${{ matrix.external-libzstd }} + run: sudo apt-get update && sudo apt-get install -y libzstd-dev + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build + - name: Test + run: PAYLOAD="$(pwd)/mr" go test -v + - name: Bench + run: PAYLOAD="$(pwd)/mr" go test -bench . + + efence: + name: golang-efence + # CircleCI ran this on resource_class: xlarge (8 vCPU). GitHub-hosted + # ubuntu-latest is 4 vCPU / 16 GB; if memory pressure or runtime becomes + # an issue under GODEBUG=efence=1, switch to a larger runner label. + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build + - name: Test (efence) + env: + GODEBUG: efence=1 + run: PAYLOAD="$(pwd)/mr" go test -v + + efence-external-libzstd: + name: golang-efence-external-libzstd + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Install libzstd-dev + run: sudo apt-get update && sudo apt-get install -y libzstd-dev + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build -tags external_libzstd + - name: Test (efence) + env: + GODEBUG: efence=1 + run: PAYLOAD="$(pwd)/mr" go test -tags external_libzstd -v + + i386: + name: golang-i386 + runs-on: ubuntu-latest + env: + GOARCH: "386" + CGO_ENABLED: "1" + CC: "gcc -m32" + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Install 32-bit toolchain + run: sudo apt-get update && sudo apt-get install -y gcc-multilib libc6-dev-i386 + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build (i386) + run: go build + - name: Test (i386) + env: + DISABLE_BIG_TESTS: "1" + PAYLOAD: ${{ github.workspace }}/mr + run: go test -v diff --git a/travis_test_32.sh b/travis_test_32.sh deleted file mode 100755 index 264ca06..0000000 --- a/travis_test_32.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Get utilities -#yum -y -q -e 0 install wget tar unzip gcc -apt-get update -apt-get -y install wget tar unzip gcc - -# Get Go -wget -q https://dl.google.com/go/go1.13.linux-386.tar.gz -tar -C /usr/local -xzf go1.13.linux-386.tar.gz -export PATH=$PATH:/usr/local/go/bin - -# Get payload -wget -q https://github.com/DataDog/zstd/files/2246767/mr.zip -unzip mr.zip - -# Build and run tests -go build -DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -v -DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -bench .