Bump crazy-max/ghaction-import-gpg from 6.3.0 to 7.0.0 (#858) #3143
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: Unit-Tests | |
| permissions: {} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| manual: | |
| description: "Manual Run" | |
| type: boolean | |
| required: true | |
| default: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| linux-unit-test: | |
| name: Build and Test on Linux | |
| strategy: | |
| matrix: | |
| job_name: | |
| ["linux-fuse3", "linux-fuse2", "linux-fuse3-arm", "linux-fuse2-arm"] | |
| include: | |
| - job_name: linux-fuse3 | |
| os: ubuntu-latest | |
| fuselib: libfuse3-dev | |
| - job_name: linux-fuse2 | |
| os: ubuntu-latest | |
| fuselib: libfuse-dev | |
| - job_name: linux-fuse3-arm | |
| os: ubuntu-24.04-arm | |
| fuselib: libfuse3-dev | |
| - job_name: linux-fuse2-arm | |
| os: ubuntu-24.04-arm | |
| fuselib: libfuse-dev | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| services: | |
| localstack: | |
| image: localstack/localstack:latest | |
| env: | |
| SERVICES: s3 | |
| AWS_DEFAULT_REGION: us-east-1 | |
| ports: | |
| - 4566:4566 | |
| azurite: | |
| image: mcr.microsoft.com/azure-storage/azurite:latest | |
| ports: | |
| - 10000:10000 | |
| - 10001:10001 | |
| - 10002:10002 | |
| env: | |
| cgo: "1" | |
| go: "1.26" | |
| zig: 0.15.2 | |
| containerName: "test-cnt-ubn" | |
| AWS_ENDPOINT: http://localhost:4566 | |
| AWS_REGION: us-east-1 | |
| AWS_ACCESS_KEY_ID: test | |
| AWS_SECRET_ACCESS_KEY: test | |
| AWS_BUCKET_NAME: test | |
| # Using default test credentials for Azurite | |
| BLOB_ENDPOINT: http://127.0.0.1:10000/devstoreaccount1 | |
| BLOB_ACCOUNT: devstoreaccount1 | |
| BLOB_KEY: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| - name: Install Zig | |
| if: runner.os == 'Linux' | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: ${{ env.zig }} | |
| cache-key: zig-${{ env.zig }}-${{ runner.arch }}-${{ runner.os }} | |
| - name: Set CGO | |
| env: | |
| ENV_CGO: ${{ env.cgo }} | |
| shell: bash | |
| run: | | |
| if [[ "${ENV_CGO}" != "" ]]; then echo 'CGO_ENABLED=${ENV_CGO}' >> $GITHUB_ENV ; fi | |
| - name: Install libfuse on Linux | |
| shell: bash | |
| env: | |
| FUSELIB: ${{ matrix.fuselib }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config fuse3 "$FUSELIB" | |
| - name: Build | |
| env: | |
| JOB_NAME: ${{ matrix.job_name }} | |
| run: | | |
| if [[ "${JOB_NAME}" == "linux-fuse2" || "${JOB_NAME}" == "linux-fuse2-arm" ]]; then | |
| ./build.sh fuse2; | |
| else | |
| ./build.sh; | |
| fi | |
| - name: Create Azure Configuration File on Linux | |
| env: | |
| BLOB_ACCOUNT: ${{ env.BLOB_ACCOUNT }} | |
| BLOB_KEY: ${{ env.BLOB_KEY }} | |
| BLOB_ENDPOINT: ${{ env.BLOB_ENDPOINT }} | |
| run: |- | |
| cnfFile=$HOME/azuretest.json | |
| echo $cnfFile | |
| touch $cnfFile | |
| echo "{" > $cnfFile | |
| echo "\"block-acct\"": "\"${BLOB_ACCOUNT}\"", >> $cnfFile | |
| echo "\"block-key\"": "\"${BLOB_KEY}\"", >> $cnfFile | |
| echo "\"endpoint\"": "\"${BLOB_ENDPOINT}\"", >> $cnfFile | |
| echo "\"skip-msi\"": "true", >> $cnfFile | |
| echo "\"skip-azcli\"": "true", >> $cnfFile | |
| echo "\"proxy-address\"": "\"\"" >> $cnfFile | |
| echo "}" >> $cnfFile | |
| - name: Create S3 Configuration File on Linux | |
| env: | |
| AWS_BUCKET_NAME: ${{ env.AWS_BUCKET_NAME }} | |
| AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} | |
| AWS_ENDPOINT: ${{ env.AWS_ENDPOINT }} | |
| AWS_REGION: ${{ env.AWS_REGION }} | |
| run: |- | |
| cnfFile=$HOME/s3test.json | |
| echo $cnfFile | |
| touch $cnfFile | |
| echo "{" > $cnfFile | |
| echo "\"bucket-name\"": "\"${AWS_BUCKET_NAME}\"", >> $cnfFile | |
| echo "\"access-key\"": "\"${AWS_ACCESS_KEY_ID}\"", >> $cnfFile | |
| echo "\"secret-key\"": "\"${AWS_SECRET_ACCESS_KEY}\"", >> $cnfFile | |
| echo "\"endpoint\"": "\"${AWS_ENDPOINT}\"", >> $cnfFile | |
| echo "\"region\"": "\"${AWS_REGION}\"", >> $cnfFile | |
| echo "\"use-path-style\"": true\ >> $cnfFile | |
| echo "}" >> $cnfFile | |
| - name: Bootstrap S3 bucket on LocalStack | |
| env: | |
| AWS_DEFAULT_REGION: ${{ env.AWS_REGION }} | |
| run: | | |
| aws --version | |
| aws --endpoint-url "${AWS_ENDPOINT}" s3 mb s3://test || true | |
| aws --endpoint-url "${AWS_ENDPOINT}" s3 ls | |
| - name: Run unit tests | |
| env: | |
| JOB_NAME: ${{ matrix.job_name }} | |
| RUNNER_ARCH: ${{ runner.arch }} | |
| GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} | |
| run: | | |
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
| # Set Zig as the C/C++ compiler for CGO during tests | |
| if [[ "${RUNNER_ARCH}" == "X64" ]]; then | |
| ZIG_TARGET="x86_64-linux-gnu" | |
| LIBDIR="/usr/lib/x86_64-linux-gnu" | |
| elif [[ "${RUNNER_ARCH}" == "ARM64" ]]; then | |
| ZIG_TARGET="aarch64-linux-gnu" | |
| LIBDIR="/usr/lib/aarch64-linux-gnu" | |
| fi | |
| export CC="zig cc -target $ZIG_TARGET" | |
| export CXX="zig c++ -target $ZIG_TARGET" | |
| echo "CC=zig cc -target $ZIG_TARGET" >> $GITHUB_ENV | |
| echo "CXX=zig c++ -target $ZIG_TARGET" >> $GITHUB_ENV | |
| export CGO_LDFLAGS="-L$LIBDIR" | |
| fi | |
| if [[ "${JOB_NAME}" == "linux-fuse2" || "${JOB_NAME}" == "linux-fuse2-arm" ]]; then | |
| go test -v -timeout=1h ./... --tags=unittest,azurite | |
| else | |
| go test -v -timeout=1h ./... --tags=unittest,azurite,fuse3 | |
| fi | |
| test: | |
| name: Build and Test on Windows | |
| strategy: | |
| matrix: | |
| os: ["windows-latest", "windows-11-arm"] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| env: | |
| go: "1.26" | |
| cgo: "0" | |
| containerName: "test-cnt-win" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| - name: Set CGO | |
| shell: bash | |
| run: | | |
| echo 'CGO_ENABLED=0' >> $GITHUB_ENV | |
| - name: Build | |
| shell: bash | |
| run: | | |
| ./build.sh | |
| - name: Run unit tests | |
| env: | |
| GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} | |
| run: go test -v -timeout=1h ./... --tags=unittest,authtest | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| env: | |
| go: "1.26" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| - run: go version | |
| - name: Set CGO | |
| shell: bash | |
| env: | |
| CGO: ${{ env.go }} | |
| run: | | |
| if [[ "${CGO}" != "" ]]; then echo 'CGO_ENABLED=${CGO}' >> $GITHUB_ENV ; fi | |
| - name: Install libfuse on Linux | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fuse3 libfuse3-dev libfuse-dev | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| - name: Notice file check | |
| run: | | |
| ./scripts/notices_fix.sh | |
| result=$(git diff NOTICE | wc -l) | |
| if [ $result -ne 0 ]; then | |
| echo "Notices needs a fix. Run ./scripts/notices_fix.sh and commit NOTICE file." | |
| exit 1 | |
| else | |
| echo "Notices are up to date." | |
| fi |