diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 530b19d..e79272c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,12 +6,9 @@ It is not: --- -Thank you for sending in this pull request. Please make sure you take a look at the [contributing file](https://github.com/actions/starter-workflows/blob/master/CONTRIBUTING.md). Here's a few things for you to consider in this pull request. +**Please note that we are not accepting new starter workflows at this time. Updates to existing starter workflows are fine.** -Please **add to this description** at the bottom :point_down: - -- [ ] A good description of the workflow at the bottom of this page. -- [ ] Some links to the language or tool will be nice (unless its really obvious) +--- In the workflow and properties files: diff --git a/.github/workflows/sync_ghes.yaml b/.github/workflows/sync_ghes.yaml index 54193bd..aa5e741 100644 --- a/.github/workflows/sync_ghes.yaml +++ b/.github/workflows/sync_ghes.yaml @@ -3,7 +3,7 @@ name: Sync workflows for GHES on: push: branches: - - master + - main jobs: sync: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f711b77..8f9d704 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,10 +4,14 @@ Hi there 👋 We are excited that you want to contribute a new workflow to this repo. By doing this you are helping people get up and running with GitHub Actions and that's cool 😎. -Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](https://github.com/actions/starter-workflows/blob/master/LICENSE). +Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](https://github.com/actions/starter-workflows/blob/main/LICENSE). Please note that this project is released with a [Contributor Code of Conduct]( -https://github.com/actions/.github/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. +https://github.com/actions/.github/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. + +**At this time we are not accepting any new starter workflows** + +### Previous guidelines for new starter workflows. Before merging a new workflow, the following requirements need to be met: diff --git a/ci/d.yml b/ci/d.yml new file mode 100644 index 0000000..8ee1d1c --- /dev/null +++ b/ci/d.yml @@ -0,0 +1,29 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +name: D + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: dlang-community/setup-dlang@7c3e57bdc1ff2d8994f00e61b3ef400e67d2d7ac + + - name: 'Build & Test' + run: | + # Build the project, with its main file included, without unittests + dub build --compiler=$DC + # Build and run tests, as defined by `unittest` configuration + # In this mode, `mainSourceFile` is excluded and `version (unittest)` are included + # See https://dub.pm/package-format-json.html#configurations + dub test --compiler=$DC diff --git a/ci/django.yml b/ci/django.yml index b9d5315..6ed9db8 100644 --- a/ci/django.yml +++ b/ci/django.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies diff --git a/ci/dotnet-core-desktop.yml b/ci/dotnet-core-desktop.yml index 341576c..480be78 100644 --- a/ci/dotnet-core-desktop.yml +++ b/ci/dotnet-core-desktop.yml @@ -109,7 +109,7 @@ jobs: # Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact - name: Upload build artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: MSIX Package path: ${{ env.Wap_Project_Directory }}\AppPackages diff --git a/ci/dotnet-core.yml b/ci/dotnet-core.yml index 03958b6..9ee1a7d 100644 --- a/ci/dotnet-core.yml +++ b/ci/dotnet-core.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.101 + dotnet-version: 3.1.301 - name: Install dependencies run: dotnet restore - name: Build diff --git a/ci/google.yml b/ci/google.yml index b8d1079..b9313b2 100644 --- a/ci/google.yml +++ b/ci/google.yml @@ -4,9 +4,11 @@ # # 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc. # -# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project, GKE_EMAIL with the service account email, GKE_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs). +# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project and GKE_SA_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs). # -# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, REGISTRY_HOSTNAME and DEPLOYMENT_NAME environment variables (below). +# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, and DEPLOYMENT_NAME environment variables (below). +# +# For more support on how to run the workflow, please visit https://github.com/GoogleCloudPlatform/github-actions/tree/master/example-workflows/gke name: Build and Deploy to GKE @@ -14,62 +16,61 @@ on: release: types: [created] -# Environment variables available to all jobs and steps in this workflow env: - GKE_PROJECT: ${{ secrets.GKE_PROJECT }} - GKE_EMAIL: ${{ secrets.GKE_EMAIL }} - GITHUB_SHA: ${{ github.sha }} - GKE_ZONE: us-west1-a - GKE_CLUSTER: example-gke-cluster - IMAGE: gke-test - REGISTRY_HOSTNAME: gcr.io - DEPLOYMENT_NAME: gke-test + PROJECT_ID: ${{ secrets.GKE_PROJECT }} + GKE_CLUSTER: cluster-1 # TODO: update to cluster name + GKE_ZONE: us-central1-c # TODO: update to cluster zone + DEPLOYMENT_NAME: gke-test # TODO: update to deployment name + IMAGE: static-site jobs: setup-build-publish-deploy: name: Setup, Build, Publish, and Deploy runs-on: ubuntu-latest - steps: + steps: - name: Checkout uses: actions/checkout@v2 # Setup gcloud CLI - - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + - uses: GoogleCloudPlatform/github-actions/setup-gcloud@0.1.3 with: - version: '270.0.0' - service_account_email: ${{ secrets.GKE_EMAIL }} - service_account_key: ${{ secrets.GKE_KEY }} + service_account_key: ${{ secrets.GKE_SA_KEY }} + project_id: ${{ secrets.GKE_PROJECT }} + + # Configure Docker to use the gcloud command-line tool as a credential + # helper for authentication + - run: |- + gcloud --quiet auth configure-docker + + # Get the GKE credentials so we can deploy to the cluster + - run: |- + gcloud container clusters get-credentials "$GKE_CLUSTER" --zone "$GKE_ZONE" - # Configure docker to use the gcloud command-line tool as a credential helper - - run: | - # Set up docker to authenticate - # via gcloud command-line tool. - gcloud auth configure-docker - # Build the Docker image - name: Build - run: | - docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \ + run: |- + docker build \ + --tag "gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA" \ --build-arg GITHUB_SHA="$GITHUB_SHA" \ - --build-arg GITHUB_REF="$GITHUB_REF" . + --build-arg GITHUB_REF="$GITHUB_REF" \ + . # Push the Docker image to Google Container Registry - name: Publish - run: | - docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA - + run: |- + docker push "gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA" + # Set up kustomize - name: Set up Kustomize - run: | - curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 + run: |- + curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 chmod u+x ./kustomize # Deploy the Docker image to the GKE cluster - name: Deploy - run: | - gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT - ./kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${GITHUB_SHA} + run: |- + ./kustomize edit set image gcr.io/PROJECT_ID/IMAGE:TAG=gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA ./kustomize build . | kubectl apply -f - kubectl rollout status deployment/$DEPLOYMENT_NAME kubectl get services -o wide diff --git a/ci/properties/d.properties.json b/ci/properties/d.properties.json new file mode 100644 index 0000000..5c67054 --- /dev/null +++ b/ci/properties/d.properties.json @@ -0,0 +1,6 @@ +{ + "name": "D", + "description": "Build and test a D project with dub.", + "iconName": "d", + "categories": [ "D" ] +} diff --git a/ci/properties/pylint.properties.json b/ci/properties/pylint.properties.json new file mode 100644 index 0000000..c7d1363 --- /dev/null +++ b/ci/properties/pylint.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Pylint", + "description": "Lint a Python application with pylint.", + "iconName": "python", + "categories": ["Python"] +} diff --git a/ci/properties/r.properties.json b/ci/properties/r.properties.json new file mode 100644 index 0000000..84ba0ec --- /dev/null +++ b/ci/properties/r.properties.json @@ -0,0 +1,6 @@ +{ + "name": "R package", + "description": "Create and test an R package on multiple R versions.", + "iconName": "r", + "categories": ["R"] +} diff --git a/ci/pylint.yml b/ci/pylint.yml new file mode 100644 index 0000000..657b06c --- /dev/null +++ b/ci/pylint.yml @@ -0,0 +1,22 @@ +name: Pylint + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Test with pytest + run: | + pylint `ls -R|grep .py$|xargs` diff --git a/ci/r.yml b/ci/r.yml new file mode 100644 index 0000000..efc6587 --- /dev/null +++ b/ci/r.yml @@ -0,0 +1,37 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# See https://github.com/r-lib/actions/tree/master/examples#readme for +# additional example workflows available for the R community. + +name: R + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + runs-on: macOS-latest + strategy: + matrix: + r-version: [3.5, 3.6] + + steps: + - uses: actions/checkout@v2 + - name: Set up R ${{ matrix.r-version }} + uses: r-lib/actions/setup-r@ffe45a39586f073cc2e9af79c4ba563b657dc6e3 + with: + r-version: ${{ matrix.r-version }} + - name: Install dependencies + run: | + install.packages(c("remotes", "rcmdcheck")) + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + - name: Check + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") + shell: Rscript {0} diff --git a/icons/d.svg b/icons/d.svg new file mode 100644 index 0000000..f2492bc --- /dev/null +++ b/icons/d.svg @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/icons/r.svg b/icons/r.svg new file mode 100644 index 0000000..78281f7 --- /dev/null +++ b/icons/r.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index ea347cf..0fa3440 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -148,18 +148,18 @@ async function checkWorkflow( console.log("Switch to GHES branch"); await exec("git", ["checkout", "ghes"]); - // In order to sync from master, we might need to remove some workflows, add some + // In order to sync from main, we might need to remove some workflows, add some // and modify others. The lazy approach is to delete all workflows first, and then - // just bring the compatible ones over from the master branch. We let git figure out + // just bring the compatible ones over from the main branch. We let git figure out // whether it's a deletion, add, or modify and commit the new state. console.log("Remove all workflows"); await exec("rm", ["-fr", ...settings.folders]); await exec("rm", ["-fr", "../../icons"]); - console.log("Sync changes from master for compatible workflows"); + console.log("Sync changes from main for compatible workflows"); await exec("git", [ "checkout", - "master", + "main", "--", ...Array.prototype.concat.apply( [],