Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use CI from rclone/rclone #1643

Closed
hwittenborn opened this issue Feb 23, 2023 · 3 comments
Closed

Unable to use CI from rclone/rclone #1643

hwittenborn opened this issue Feb 23, 2023 · 3 comments
Labels
kind/bug Something isn't working stale

Comments

@hwittenborn
Copy link

hwittenborn commented Feb 23, 2023

Bug report info

act version:            0.2.42
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/hunter/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.1
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-buildmode:           pie
		-compiler:            gc
		-trimpath:            true
		CGO_ENABLED:          1
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         b86b4a7db3dfc81de963e9b064c63bf1187b16a5
		vcs.time:             2022-10-17T05:34:26Z
		vcs.modified:         true
Docker Engine:
	Engine version:        20.10.16
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 22.10
	OS type:               linux
	OS version:            22.10
	OS arch:               x86_64
	OS kernel:             5.19.0-31-generic
	OS CPU:                4
	OS memory:             3332 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act --job lint

Describe issue

I expected rclone/rclone's CI to to run, but instead I get the following error:

Error:   ❌  Error in if-expression: "if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}" (TODO: evaluateCompare not implemented! left: invalid, right: invalid)

Link to GitHub repository

https://github.com/rclone/rclone

Workflow content

---
# Github Actions build for rclone
# -*- compile-command: "yamllint -f parsable build.yml" -*-

name: build

# Trigger the workflow on push or pull request
on:
  push:
    branches:
      - '*'
    tags:
      - '*'
  pull_request:
  workflow_dispatch:
    inputs:
      manual:
        description: Manual run (bypass default conditions)
        type: boolean
        required: true
        default: true

jobs:
  build:
    if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.18', 'go1.19']

        include:
          - job_name: linux
            os: ubuntu-latest
            go: '1.20'
            gotags: cmount
            build_flags: '-include "^linux/"'
            check: true
            quicktest: true
            racequicktest: true
            librclonetest: true
            deploy: true

          - job_name: linux_386
            os: ubuntu-latest
            go: '1.20'
            goarch: 386
            gotags: cmount
            quicktest: true

          - job_name: mac_amd64
            os: macos-11
            go: '1.20'
            gotags: 'cmount'
            build_flags: '-include "^darwin/amd64" -cgo'
            quicktest: true
            racequicktest: true
            deploy: true

          - job_name: mac_arm64
            os: macos-11
            go: '1.20'
            gotags: 'cmount'
            build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
            deploy: true

          - job_name: windows
            os: windows-latest
            go: '1.20'
            gotags: cmount
            cgo: '0'
            build_flags: '-include "^windows/"'
            build_args: '-buildmode exe'
            quicktest: true
            deploy: true

          - job_name: other_os
            os: ubuntu-latest
            go: '1.20'
            build_flags: '-exclude "^(windows/|darwin/|linux/)"'
            compile_all: true
            deploy: true

          - job_name: go1.18
            os: ubuntu-latest
            go: '1.18'
            quicktest: true
            racequicktest: true

          - job_name: go1.19
            os: ubuntu-latest
            go: '1.19'
            quicktest: true
            racequicktest: true

    name: ${{ matrix.job_name }}

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Install Go
        uses: actions/setup-go@v3
        with:
          go-version: ${{ matrix.go }}
          check-latest: true

      - name: Set environment variables
        shell: bash
        run: |
          echo 'GOTAGS=${{ matrix.gotags }}' >> $GITHUB_ENV
          echo 'BUILD_FLAGS=${{ matrix.build_flags }}' >> $GITHUB_ENV
          echo 'BUILD_ARGS=${{ matrix.build_args }}' >> $GITHUB_ENV
          if [[ "${{ matrix.goarch }}" != "" ]]; then echo 'GOARCH=${{ matrix.goarch }}' >> $GITHUB_ENV ; fi
          if [[ "${{ matrix.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ matrix.cgo }}' >> $GITHUB_ENV ; fi

      - name: Install Libraries on Linux
        shell: bash
        run: |
          sudo modprobe fuse
          sudo chmod 666 /dev/fuse
          sudo chown root:$USER /etc/fuse.conf
          sudo apt-get install fuse3 libfuse-dev rpm pkg-config
        if: matrix.os == 'ubuntu-latest'

      - name: Install Libraries on macOS
        shell: bash
        run: |
          brew update
          brew install --cask macfuse
        if: matrix.os == 'macos-11'

      - name: Install Libraries on Windows
        shell: powershell
        run: |
          $ProgressPreference = 'SilentlyContinue'
          choco install -y winfsp zip
          echo "CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
          if ($env:GOARCH -eq "386") {
            choco install -y mingw --forcex86 --force
            echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
          }
          # Copy mingw32-make.exe to make.exe so the same command line
          # can be used on Windows as on macOS and Linux
          $path = (get-command mingw32-make.exe).Path
          Copy-Item -Path $path -Destination (Join-Path (Split-Path -Path $path) 'make.exe')
        if: matrix.os == 'windows-latest'

      - name: Print Go version and environment
        shell: bash
        run: |
          printf "Using go at: $(which go)\n"
          printf "Go version: $(go version)\n"
          printf "\n\nGo environment:\n\n"
          go env
          printf "\n\nRclone environment:\n\n"
          make vars
          printf "\n\nSystem environment:\n\n"
          env

      - name: Go module cache
        uses: actions/cache@v3
        with:
          path: ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-

      - name: Build rclone
        shell: bash
        run: |
          make

      - name: Rclone version
        shell: bash
        run: |
          rclone version

      - name: Run tests
        shell: bash
        run: |
          make quicktest
        if: matrix.quicktest

      - name: Race test
        shell: bash
        run: |
          make racequicktest
        if: matrix.racequicktest

      - name: Run librclone tests
        shell: bash
        run: |
          make -C librclone/ctest test
          make -C librclone/ctest clean
          librclone/python/test_rclone.py
        if: matrix.librclonetest

      - name: Compile all architectures test
        shell: bash
        run: |
          make
          make compile_all
        if: matrix.compile_all

      - name: Deploy built binaries
        shell: bash
        run: |
          if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then make release_dep_linux ; fi
          if [[ "${{ matrix.os }}" == "windows-latest" ]]; then make release_dep_windows ; fi
          make ci_beta
        env:
          RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
        # working-directory: '$(modulePath)'
        # Deploy binaries if enabled in config && not a PR && not a fork
        if: matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone'

  lint:
    if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}
    timeout-minutes: 30
    name: "lint"
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Code quality test
        uses: golangci/golangci-lint-action@v3
        with:
          # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
          version: latest

      # Run govulncheck on the latest go version, the one we build binaries with
      - name: Install Go
        uses: actions/setup-go@v3
        with:
          go-version: '1.20'
          check-latest: true

      - name: Install govulncheck
        run: go install golang.org/x/vuln/cmd/govulncheck@latest

      - name: Scan for vulnerabilities
        run: govulncheck ./...

  android:
    if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}
    timeout-minutes: 30
    name: "android-all"
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      # Upgrade together with NDK version
      - name: Set up Go
        uses: actions/setup-go@v3
        with:
          go-version: '1.20'

      - name: Go module cache
        uses: actions/cache@v3
        with:
          path: ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-

      - name: Set global environment variables
        shell: bash
        run: |
          echo "VERSION=$(make version)" >> $GITHUB_ENV

      - name: build native rclone
        run: |
          make

      - name: install gomobile
        run: |
          go install golang.org/x/mobile/cmd/gobind@latest
          go install golang.org/x/mobile/cmd/gomobile@latest
          env PATH=$PATH:~/go/bin gomobile init
          echo "RCLONE_NDK_VERSION=21" >> $GITHUB_ENV

      - name: arm-v7a gomobile build
        run: env PATH=$PATH:~/go/bin gomobile bind -androidapi ${RCLONE_NDK_VERSION} -v -target=android/arm -javapkg=org.rclone -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} github.com/rclone/rclone/librclone/gomobile

      - name: arm-v7a Set environment variables
        shell: bash
        run: |
          echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
          echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
          echo 'GOOS=android' >> $GITHUB_ENV
          echo 'GOARCH=arm' >> $GITHUB_ENV
          echo 'GOARM=7' >> $GITHUB_ENV
          echo 'CGO_ENABLED=1' >> $GITHUB_ENV
          echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV

      - name: arm-v7a build
        run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-armv7a .

      - name: arm64-v8a Set environment variables
        shell: bash
        run: |
          echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
          echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
          echo 'GOOS=android' >> $GITHUB_ENV
          echo 'GOARCH=arm64' >> $GITHUB_ENV
          echo 'CGO_ENABLED=1' >> $GITHUB_ENV
          echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV

      - name: arm64-v8a build
        run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-armv8a .

      - name: x86 Set environment variables
        shell: bash
        run: |
          echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
          echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
          echo 'GOOS=android' >> $GITHUB_ENV
          echo 'GOARCH=386' >> $GITHUB_ENV
          echo 'CGO_ENABLED=1' >> $GITHUB_ENV
          echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV

      - name: x86 build
        run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-x86 .

      - name: x64 Set environment variables
        shell: bash
        run: |
          echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
          echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
          echo 'GOOS=android' >> $GITHUB_ENV
          echo 'GOARCH=amd64' >> $GITHUB_ENV
          echo 'CGO_ENABLED=1' >> $GITHUB_ENV
          echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV

      - name: x64 build
        run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-x64 .

      - name: Upload artifacts
        run: |
          make ci_upload
        env:
          RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
        # Upload artifacts if not a PR && not a fork
        if: github.head_ref == '' && github.repository == 'rclone/rclone'

Relevant log output

# act --job lint -v
DEBU[0000] Loading environment from /home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.env 
DEBU[0000] Loading action inputs from /home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.input 
DEBU[0000] Loading secrets from /home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.secrets 
DEBU[0000] Loading workflows from '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'build.yml' in '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build.yml' 
DEBU[0000] Found workflow 'build_publish_docker_image.yml' in '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build_publish_docker_image.yml' 
DEBU[0000] Conditional GET for notices etag=b3871570-1ec1-463f-b2b1-b3aa7a697986 
DEBU[0000] Found workflow 'build_publish_release_docker_image.yml' in '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build_publish_release_docker_image.yml' 
DEBU[0000] Reading workflow '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build.yml' 
DEBU[0000] Reading workflow '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build_publish_docker_image.yml' 
DEBU[0000] Reading workflow '/home/hunter/Documents/Git/GitHub/hwittenborn/rclone/.github/workflows/build_publish_release_docker_image.yml' 
DEBU[0000] Preparing plan with a job: lint              
DEBU[0000] Using default workflow event: push           
DEBU[0000] Planning job: lint                           
DEBU[0000] Loading revision from git directory          
DEBU[0000] Found revision: 46e590a9ac3b1388d498713befb8ee53cb82675e 
DEBU[0000] HEAD points to '46e590a9ac3b1388d498713befb8ee53cb82675e' 
DEBU[0000] using github ref: refs/heads/auth-templates  
DEBU[0000] Found revision: 46e590a9ac3b1388d498713befb8ee53cb82675e 
[build/lint] [DEBUG] evaluating expression '${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}'
[build/lint] [DEBUG] expression '${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}' evaluated to '%!t(<nil>)'
Error:   ❌  Error in if-expression: "if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}" (TODO: evaluateCompare not implemented! left: invalid, right: invalid)

Additional information

No response

@hwittenborn hwittenborn added the kind/bug Something isn't working label Feb 23, 2023
alex-savchuk added a commit to alex-savchuk/act that referenced this issue Feb 23, 2023
 fix: compare properties of Invalid types nektos#1643
@alex-savchuk
Copy link
Contributor

Problem is in this part "github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name"
Both of these properties are not available which leads to comparison of values of "Invalid" type which leads to reporting of error.

@catthehacker
Copy link
Member

alex-savchuk added a commit to alex-savchuk/act that referenced this issue Mar 1, 2023
 fix: compare properties of Invalid types nektos#1643
mergify bot pushed a commit that referenced this issue Mar 3, 2023
* fix: compare properties of Invalid types

 fix: compare properties of Invalid types #1643

* fix linter problem

* Fix review comment
@github-actions
Copy link
Contributor

Issue is stale and will be closed in 14 days unless there is new activity

@github-actions github-actions bot added the stale label Aug 23, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants