From d30f415002f9d7c229133bc0ee591684c838fde7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 14 Oct 2020 15:02:53 +0000 Subject: [PATCH] Updating GHES workflows --- ci/ada.yml | 24 ++ ci/blank.yml | 20 +- ci/cmake.yml | 46 +++ ci/docker-publish.yml | 9 +- ci/dotnet-core.yml | 2 +- ci/ios.yml | 42 +++ ci/npm-publish.yml | 2 +- ci/properties/ada.properties.json | 6 + ci/properties/cmake.properties.json | 6 + ci/properties/ios.properties.json | 9 + icons/ada.svg | 283 ++++++++++++++++ icons/cmake.svg | 493 ++++++++++++++++++++++++++++ icons/xcode.svg | 1 + 13 files changed, 927 insertions(+), 16 deletions(-) create mode 100644 ci/ada.yml create mode 100644 ci/cmake.yml create mode 100644 ci/ios.yml create mode 100644 ci/properties/ada.properties.json create mode 100644 ci/properties/cmake.properties.json create mode 100644 ci/properties/ios.properties.json create mode 100644 icons/ada.svg create mode 100644 icons/cmake.svg create mode 100644 icons/xcode.svg diff --git a/ci/ada.yml b/ci/ada.yml new file mode 100644 index 0000000..a27902a --- /dev/null +++ b/ci/ada.yml @@ -0,0 +1,24 @@ +name: Ada (GNAT) + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up GNAT toolchain + run: > + sudo apt-get update && + sudo apt-get install gnat gprbuild + + - name: Build + run: gprbuild -j0 -p diff --git a/ci/blank.yml b/ci/blank.yml index 72f1f16..f7816e9 100644 --- a/ci/blank.yml +++ b/ci/blank.yml @@ -19,15 +19,15 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. diff --git a/ci/cmake.yml b/ci/cmake.yml new file mode 100644 index 0000000..dae54ec --- /dev/null +++ b/ci/cmake.yml @@ -0,0 +1,46 @@ +name: CMake + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{runner.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{runner.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{runner.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE + + - name: Test + working-directory: ${{runner.workspace}}/build + shell: bash + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $BUILD_TYPE diff --git a/ci/docker-publish.yml b/ci/docker-publish.yml index 76756db..fc5439b 100644 --- a/ci/docker-publish.yml +++ b/ci/docker-publish.yml @@ -50,12 +50,13 @@ jobs: - name: Build image run: docker build . --file Dockerfile --tag $IMAGE_NAME - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin + - name: Log into GitHub Container Registry + # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` + run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push image + - name: Push image to GitHub Container Registry run: | - IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME # Change all uppercase to lowercase IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') 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/ios.yml b/ci/ios.yml new file mode 100644 index 0000000..64b14a3 --- /dev/null +++ b/ci/ios.yml @@ -0,0 +1,42 @@ +name: iOS starter workflow + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + name: Build and Test default scheme using any available iPhone simulator + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + device=`instruments -s -devices | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" + - name: Test + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + device=`instruments -s -devices | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" diff --git a/ci/npm-publish.yml b/ci/npm-publish.yml index 861e372..b460edc 100644 --- a/ci/npm-publish.yml +++ b/ci/npm-publish.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 12 - registry-url: https://npm.pkg.github.com/ + registry-url: $registry-url(npm) - run: npm ci - run: npm publish env: diff --git a/ci/properties/ada.properties.json b/ci/properties/ada.properties.json new file mode 100644 index 0000000..71021d0 --- /dev/null +++ b/ci/properties/ada.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Ada", + "description": "Build Ada project with GPRbuild.", + "iconName": "ada", + "categories": ["Ada"] +} diff --git a/ci/properties/cmake.properties.json b/ci/properties/cmake.properties.json new file mode 100644 index 0000000..ac001c3 --- /dev/null +++ b/ci/properties/cmake.properties.json @@ -0,0 +1,6 @@ +{ + "name": "CMake based projects", + "description": "Build and test a CMake based project.", + "iconName": "cmake", + "categories": ["C", "C++"] +} \ No newline at end of file diff --git a/ci/properties/ios.properties.json b/ci/properties/ios.properties.json new file mode 100644 index 0000000..0b3a9ed --- /dev/null +++ b/ci/properties/ios.properties.json @@ -0,0 +1,9 @@ +{ + "name": "iOS", + "description": "Build and test an iOS application using xcodebuild and any available iPhone simulator.", + "iconName": "xcode", + "categories": [ + "iOS", + "Xcode" + ] +} diff --git a/icons/ada.svg b/icons/ada.svg new file mode 100644 index 0000000..6a0d58f --- /dev/null +++ b/icons/ada.svg @@ -0,0 +1,283 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/cmake.svg b/icons/cmake.svg new file mode 100644 index 0000000..254fe01 --- /dev/null +++ b/icons/cmake.svg @@ -0,0 +1,493 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/xcode.svg b/icons/xcode.svg new file mode 100644 index 0000000..a09ea44 --- /dev/null +++ b/icons/xcode.svg @@ -0,0 +1 @@ + \ No newline at end of file