Migrate from Travis to GitHub Actions
# with '#' will be ignored, and an empty message aborts the commit.
ADD
.github/workflows/ci.yml
+name: Run Examples Tests
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+# schedule:
+# # * is a special character in YAML so you have to quote this string.
+# # Run every day at 09:00AM.
+# - cron: '0 9 * * *'
+
+env:
+ PULUMI_TEST_OWNER: ${{ secrets.PULUMI_TEST_OWNER }}
+ PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ AWS_REGION: "us-west-2"
+ ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
+ ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
+ ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
+ ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
+ ARM_ENVIRONMENT: "public"
+ ARM_LOCATION: "westus"
+ DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
+ CLOUDSDK_CORE_DISABLE_PROMPTS: 1
+ GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
+ GOOGLE_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
+ GOOGLE_REGION: "us-central1"
+ GOOGLE_ZONE: "us-central1-a"
+ PACKET_AUTH_TOKEN: ${{ secrets.PACKET_AUTH_TOKEN }}
+ LINODE_API_TOKEN: ${{ secrets.LINODE_API_TOKEN }}
+jobs:
+ released:
+ strategy:
+ matrix:
+ tests-set: ["DigitalOcean", "Aws", "Azure", "Gcp", "Packet", "Linode", "Cloud"]
+ platform: [ubuntu-latest]
+ go-version: [1.13.x]
+ node-version: [10.x]
+ python-version: [3.7]
+ dotnet-version: ['3.1.100']
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install DotNet ${{ matrix.dotnet-version }}
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: ${{ matrix.dotnet-version }}
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Set up Go ${{ matrix.go-version }}
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{ matrix.go-version }}
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install Python Deps
+ run: |
+ pip3 install pipenv
+ - name: Install aws-iam-authenticator
+ run: |
+ curl -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.13.7/2019-06-11/bin/linux/amd64/aws-iam-authenticator
+ chmod +x ./aws-iam-authenticator
+ sudo mv aws-iam-authenticator /usr/local/bin
+ - name: Install Kubectl
+ run: |
+ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
+ chmod +x ./kubectl
+ sudo mv kubectl /usr/local/bin
+ - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
+ with:
+ version: '285.0.0'
+ project_id: ${{ secrets.GCP_PROJECT_ID }}
+ service_account_email: ${{ secrets.GCP_SA_EMAIL }}
+ service_account_key: ${{ secrets.GCP_SA_KEY }}
+ - name: Install helm
+ run: |
+ curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
+ - name: Configure helm
+ run: |
+ helm init -c
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ - name: Set Azure DNS
+ run: |
+ echo "$(getent hosts $ARM_LOCATION.management.azure.com | awk '{ print $1 }') management.azure.com" | sudo tee --append /etc/hosts
+ - name: Login to Google Cloud Registry
+ run: |
+ gcloud --quiet auth configure-docker
+ - name: Install Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@releases/v1
+ - uses: actions/checkout@v2
+ - name: Install Go dependencies
+ run: make ensure
+ - name: Run ${{ matrix.tests-set }} Tests
+ run: make specific_test_set TestSet=${{ matrix.tests-set }}
+ lint:
+ strategy:
+ matrix:
+ platform: [ubuntu-latest]
+ yarn-version: [1.13.0]
+ node-version: [12.x]
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup node
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Install Yarn
+ run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${{ matrix.yarn-version }}
+ - name: Update PATH for Yarn
+ run: |
+ echo "::add-path::$HOME/.yarn/bin"
+ echo "::add-path::$HOME/.config/yarn/global/node_modules/.bin"
+ - name: setup linting tool
+ run: make install
+ - name: Lint typescript files
+ run: make lint

MODIFY
.travis.yml
.travis.yml
@@ -43,8 +43,6 @@ before_script:
- echo "$(getent hosts $ARM_LOCATION.management.azure.com | awk '{ print $1 }') management.azure.com" | sudo tee --append /etc/hosts
jobs:
include:
- - script: make travis_${TRAVIS_EVENT_TYPE}
- name: released
- script: "${GOPATH}/src/github.com/pulumi/scripts/ci/run-at-head"
name: latest-all
if: type = cron

MODIFY
Makefile
Makefile
@@ -17,6 +17,10 @@ lint:
only_test:
cd misc/test && go test ./... --timeout 4h -v -count=1 -short -parallel 40
+specific_test_set:
+ echo "running $(TestSet) Acceptance Tests"
+ cd misc/test && go test ./... --timeout 4h -v -count=1 -short -parallel 40 --run=TestAcc$(TestSet)
+
# The travis_* targets are entrypoints for CI.
.PHONY: travis_cron travis_push travis_pull_request travis_api
travis_cron: all

DELETE
misc/travis/README.md
-# Travis Integration
-
-This directory contains some helpful example scripts for doing continuous deployment using Pulumi with Travis as
-your continuous integration service.
-
-For more comprehensive information about how to accomplish Travis integration, see
-https://www.pulumi.com/docs/guides/continuous-delivery/travis/.

DELETE
misc/travis/update-stack.sh
-#!/bin/bash
-
-set -o nounset -o errexit -o pipefail
-
-# NOTE: You need to configure Travis to set the following environment variables:
-# PULUMI_ACCESS_TOKEN Your Pulumi access token, from https://pulumi.com/account.
-if [ -z "${PULUMI_ACCESS_TOKEN}" ]; then
- >&2 echo "error: Missing PULUMI_ACCCESS_TOKEN; required to log into Pulumi.com"
-fi
-
-echo "Deploying Pulumi Application via Travis"
-echo "TRAVIS_BRANCH : ${TRAVIS_BRANCH}"
-echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}"
-
-# Only do deployments for pushes, not PRs.
-if [ "$TRAVIS_EVENT_TYPE" != "push" ]; then
- echo "Non-push event type. Ignoring."
- exit 0
-fi
-
-# Set PULUMI_STACK_NAMES to be one or more Pulumi stacks you wish to update. DIRS should contain the location of
-# the Pulumi Program to perform the preview/update.
-BASE=$(dirname "${BASH_SOURCE}")
-case "$TRAVIS_BRANCH" in
- master)
- export PULUMI_STACK_NAMES=( "development" )
- export DIRS=( "$BASE/../infra" )
- ;;
- staging)
- export PULUMI_STACK_NAMES=( "staging" )
- export DIRS=( "$BASE/../infra" )
- ;;
- production)
- # Deploy to two environments in production, west coast first, east coast second.
- export PULUMI_STACK_NAMES=( "production-west" "production-east" )
- export DIRS=( "$BASE/../infra" "$BASE/../infra" )
- ;;
- *)
- echo "Branch '${TRAVIS_BRANCH}' is not associated with a Pulumi stack. Ignoring."
- exit 0
-esac
-
-# For each Stack, do a preview/update.
-for ((i=0; i<${#PULUMI_STACK_NAMES[*]}; i++));
-do
- :
- export PULUMI_STACK_NAME="${PULUMI_STACK_NAMES[i]}"
- export DIR="${DIRS[i]}"
-
- # CD into the Pulumi program folder.
- cd "${DIR}"
-
- # Authenticate with Pulumi so we fail early if we cannot.
- echo "Logging into Pulumi.com:"
- pulumi login
- pulumi stack select $PULUMI_STACK_NAME
-
- # Install dependencies and build the program.
- yarn install
- yarn build
-
- # First do a preview. This step is optional, but provides a basic check against a class of runtime errors
- # in your Pulumi program. (e.g. typos, missing dependencies, etc.)
- echo "Previewing Pulumi updates:"
- pulumi preview
-
- # Finally, perform the actual update.
- echo "Deploying Pulumi updates:"
- pulumi up
-done

Migrate from Travis to GitHub Actions (#650)

:# with '#' will be ignored, and an empty message aborts the commit.