gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/.cirrus.yml (about)

     1  freebsd_instance:
     2    # Keep this up to date over time, but use stable images only.
     3    # We have run into issues while using a -snap image. Available images:
     4    # https://cirrus-ci.org/guide/FreeBSD/#list-of-available-image-families
     5    # Upstream FreeBSD release information: https://www.freebsd.org/where.html
     6    image_family: freebsd-12-1
     7  
     8  task_template: &REGULAR_TASK_TEMPLATE
     9    provision_script:
    10      - pkg install -y go dep git
    11    # see https://cirrus-ci.org/guide/tips-and-tricks/#custom-clone-command
    12    # for Golang, we need to have a src/gitrepo.host/owner/project structure
    13    clone_script: |
    14      export GIT_URL="https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git"
    15      export CIRRUS_WORKING_DIR=$CIRRUS_WORKING_DIR/src/github.com/${CIRRUS_REPO_FULL_NAME}
    16      mkdir -p $CIRRUS_WORKING_DIR
    17      cd $CIRRUS_WORKING_DIR
    18      if [ -z "$CIRRUS_PR" ]; then
    19        echo "regular build $CIRRUS_CHANGE_IN_REPO"
    20        git clone --recursive --branch=$CIRRUS_BRANCH $GIT_URL $CIRRUS_WORKING_DIR
    21        git reset --hard $CIRRUS_CHANGE_IN_REPO
    22      else
    23        echo "PR build $CIRRUS_PR $CIRRUS_CHANGE_IN_REPO"
    24        git clone --recursive $GIT_URL $CIRRUS_WORKING_DIR
    25        git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
    26        git reset --hard $CIRRUS_CHANGE_IN_REPO
    27      fi
    28  
    29  test_task:
    30    << : *REGULAR_TASK_TEMPLATE
    31    script: |
    32      export GOPATH=$CIRRUS_WORKING_DIR
    33      export CIRRUS_WORKING_DIR=$CIRRUS_WORKING_DIR/src/github.com/${CIRRUS_REPO_FULL_NAME}
    34      cd $CIRRUS_WORKING_DIR
    35      dep version
    36      dep status
    37      dep ensure -vendor-only
    38      git status
    39      if [ -n "$(git status --porcelain vendor)" ]; then
    40        echo '`vendor/` is out-of-date: run `dep ensure -vendor-only` and then'
    41        echo 'check in the changes. If `dep ensure` results in no changes, make'
    42        echo 'sure you are using the latest release of dep.'
    43        git status --porcelain vendor
    44        exit 1
    45      fi
    46  
    47  build_task:
    48    << : *REGULAR_TASK_TEMPLATE
    49    depends_on:
    50      - test
    51    prepare_script: |
    52      export GOPATH=$CIRRUS_WORKING_DIR
    53      export CIRRUS_WORKING_DIR=$CIRRUS_WORKING_DIR/src/github.com/${CIRRUS_REPO_FULL_NAME}
    54      cd $CIRRUS_WORKING_DIR
    55      dep ensure
    56    script: |
    57      export GOPATH=$CIRRUS_WORKING_DIR
    58      export CIRRUS_WORKING_DIR=$CIRRUS_WORKING_DIR/src/github.com/${CIRRUS_REPO_FULL_NAME}
    59      cd $CIRRUS_WORKING_DIR
    60      go build