fix k3s #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| pull_request: | |
| paths: | |
| - configure | |
| - 'auto/**' | |
| - 'go/**' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'pkg/contrib/**' | |
| - '.github/workflows/ci.yml' | |
| push: | |
| branches: master | |
| paths: | |
| - configure | |
| - 'auto/**' | |
| - 'go/**' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'pkg/contrib/**' | |
| - '.github/workflows/ci.yml' | |
| jobs: | |
| test: | |
| runs-on: | |
| # group: xmis | |
| labels: [self-hosted, k3s] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Core | |
| - build: unit | |
| os: ubuntu-latest | |
| # Modules | |
| - build: go-1.22 | |
| - build: php-8.3 | |
| - build: php-8.4 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Provides module, language version and testpath from build name | |
| - name: Output build metadata | |
| id: metadata | |
| run: | | |
| if [ "${{ matrix.build }}" = "wasm-wasi-component" ]; then | |
| module="wasm-wasi-component" | |
| else | |
| # Split the build name by '-' into module and version | |
| IFS='-' read -r module version <<< "${{ matrix.build }}" | |
| fi | |
| testpath="test/test_${module}*" | |
| # Run all tests for "unit" and "python" | |
| # Python is the default module for tests | |
| if [ "$module" = "unit" ] || [ "$module" = "python" ]; then | |
| testpath="test" | |
| fi | |
| echo "module=${module}" >> "$GITHUB_OUTPUT" | |
| echo "version=${version}" >> "$GITHUB_OUTPUT" | |
| echo "testpath=${testpath}" >> "$GITHUB_OUTPUT" | |
| NJS_VERSION=$(sed -n "s/NJS_VERSION := \(.*\)/\1/p" pkg/contrib/src/njs/version) | |
| echo "njs_version=${NJS_VERSION}" >> "$GITHUB_OUTPUT" | |
| cat "$GITHUB_OUTPUT" | |
| # https://github.com/actions/runner-images/issues/2821 | |
| - name: Kill mono process | |
| run: | | |
| set +e | |
| sudo systemctl status mono-xsp4.service | |
| if [ $? -ne 0 ]; then | |
| true | |
| else | |
| sudo systemctl stop mono-xsp4.service | |
| sudo systemctl mask mono-xsp4.service | |
| sudo systemctl status mono-xsp4.service | |
| PID=$(sudo lsof -t -i :8084) | |
| echo "Killing PID $PID" | |
| sudo kill -9 $PID | |
| fi | |
| - name: Install packages | |
| run: sudo apt-get -y install libbrotli-dev | |
| ## | |
| ## njs | |
| ## | |
| - name: Clone njs repository | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: nginx/njs | |
| ref: '${{ steps.metadata.outputs.njs_version }}' | |
| path: njs | |
| - name: Make njs | |
| run: | | |
| ./configure --no-libxml2 --no-zlib | |
| make -j4 -k | |
| working-directory: njs | |
| ## | |
| ## Unit | |
| ## | |
| - name: Configure unit | |
| run: | | |
| ./configure \ | |
| --tests \ | |
| --openssl \ | |
| --njs \ | |
| --zlib \ | |
| --zstd \ | |
| --brotli \ | |
| --cc-opt="-I njs/src/ -I njs/build" \ | |
| --ld-opt="-L njs/build" | |
| - name: Make unit | |
| run: | | |
| make -j4 -k || make | |
| ## | |
| ## Go | |
| ## | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '${{ steps.metadata.outputs.version }}' | |
| cache: false | |
| if: steps.metadata.outputs.module == 'go' | |
| - name: Configure go | |
| run: | | |
| ./configure go --go-path= | |
| if: steps.metadata.outputs.module == 'go' | |
| - name: Make go | |
| run: | | |
| make go | |
| make go-install | |
| if: steps.metadata.outputs.module == 'go' | |
| ## | |
| ## PHP | |
| ## | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '${{ steps.metadata.outputs.version }}' | |
| extensions: none | |
| env: | |
| update: true | |
| if: steps.metadata.outputs.module == 'php' | |
| - name: Configure php | |
| run: | | |
| ./configure php | |
| if: steps.metadata.outputs.module == 'php' | |
| - name: Make php | |
| run: | | |
| make php | |
| if: steps.metadata.outputs.module == 'php' | |
| ## | |
| ## Tests | |
| ## | |
| # /home/runner will be root only after calling sudo above | |
| # Ensure all users and processes can execute | |
| - name: Fix permissions | |
| run: | | |
| sudo chmod -R +x "$GITHUB_WORKSPACE" | |
| namei -l "$GITHUB_WORKSPACE" | |