From 21dee8dfb768207a3e2d27255917395441317aed Mon Sep 17 00:00:00 2001 From: Rauhul Varma Date: Mon, 19 Aug 2024 13:32:09 -0700 Subject: [PATCH] Add GitHub workflows for CI (#111) Adds GitHub Actions based workflows for Linux CI testing instead of using Swift CI. Removes docker files. --- .github/workflows/swift.yml | 49 ++++++++++++++++++++++++++++ CODEOWNERS | 21 ++---------- Docker/Dockerfile | 15 --------- Docker/docker-compose.2204.510.yaml | 22 ------------- Docker/docker-compose.2204.59.yaml | 22 ------------- Docker/docker-compose.2204.main.yaml | 20 ------------ Docker/docker-compose.yaml | 32 ------------------ Makefile | 7 +--- 8 files changed, 52 insertions(+), 136 deletions(-) create mode 100644 .github/workflows/swift.yml delete mode 100644 Docker/Dockerfile delete mode 100644 Docker/docker-compose.2204.510.yaml delete mode 100644 Docker/docker-compose.2204.59.yaml delete mode 100644 Docker/docker-compose.2204.main.yaml delete mode 100644 Docker/docker-compose.yaml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 00000000..c7844f8f --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,49 @@ +name: Swift + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Swift (${{ matrix.swift.version }}) / Ubuntu (${{ matrix.os.version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - name: jammy + version: "22.04" + swift: + - repo: swift + version: "5.9" + - repo: swift + version: "5.10" + - repo: swiftlang/swift + version: "nightly-6.0" + - repo: swiftlang/swift + version: "nightly-main" + container: ${{ matrix.swift.repo }}:${{ matrix.swift.version }}-${{ matrix.os.name }} + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: apt-get -qq update && apt-get -qq -y install make + - name: Build & Test + run: make test CONFIGURATION=release + + lint: + name: Lint + runs-on: ubuntu-latest + container: swiftlang/swift:nightly-6.0-jammy + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: apt-get -qq update && apt-get -qq -y install make + - name: Lint + run: make lint diff --git a/CODEOWNERS b/CODEOWNERS index 5ff0d9e9..c9e1a167 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,19 +1,2 @@ -# This file is a list of the people responsible for ensuring that patches for a -# particular part of Swift are reviewed, either by themselves or by someone else. -# They are also the gatekeepers for their part of Swift, with the final word on -# what goes in or not. -# -# The list is sorted by surname and formatted to allow easy grepping and -# beautification by scripts. The fields are: name (N), email (E), web-address -# (W), PGP key ID and fingerprint (P), description (D), and snail-mail address -# (S). - -# N: Rauhul Varma -# E: rauhul@apple.com -# D: Everything in swift-mmio not covered by someone else - -### - -# The following lines are used by GitHub to automatically recommend reviewers. - -* @rauhul +* @rauhul +.github/workflows @rauhul @shahmishal diff --git a/Docker/Dockerfile b/Docker/Dockerfile deleted file mode 100644 index 33e74219..00000000 --- a/Docker/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -ARG namespace=swift -ARG swift_version=5.9 -ARG ubuntu_version=jammy -ARG base_image=$namespace:$swift_version-$ubuntu_version - -# Swift-MMIO Builder ----------------------------------------------------------- -FROM $base_image as swift-mmio-builder - -# Install packages -RUN apt-get update && apt-get install -y locales locales-all make - -# set as UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 diff --git a/Docker/docker-compose.2204.510.yaml b/Docker/docker-compose.2204.510.yaml deleted file mode 100644 index 3290cf93..00000000 --- a/Docker/docker-compose.2204.510.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-mmio:22.04-5.10 - build: - args: - namespace: "swift" - ubuntu_version: "jammy" - swift_version: "5.10" - - soundness: - image: swift-mmio:22.04-5.10 - command: /bin/bash -xcl "swift -version && uname -a" - - test: - image: swift-mmio:22.04-5.10 - command: /bin/bash -xcl "make test CONFIGURATION=release SKIP_LINT=1" - - shell: - image: swift-mmio:22.04-5.10 diff --git a/Docker/docker-compose.2204.59.yaml b/Docker/docker-compose.2204.59.yaml deleted file mode 100644 index d647aa70..00000000 --- a/Docker/docker-compose.2204.59.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-mmio:22.04-5.9.2 - build: - args: - namespace: "swift" - ubuntu_version: "jammy" - swift_version: "5.9.2" - - soundness: - image: swift-mmio:22.04-5.9.2 - command: /bin/bash -xcl "swift -version && uname -a" - - test: - image: swift-mmio:22.04-5.9.2 - command: /bin/bash -xcl "make test CONFIGURATION=release SKIP_LINT=1" - - shell: - image: swift-mmio:22.04-5.9.2 diff --git a/Docker/docker-compose.2204.main.yaml b/Docker/docker-compose.2204.main.yaml deleted file mode 100644 index ef5c49ff..00000000 --- a/Docker/docker-compose.2204.main.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-mmio:22.04-main - build: - args: - namespace: "swiftlang/swift" - ubuntu_version: "jammy" - swift_version: "nightly" - - soundness: - image: swift-mmio:22.04-main - - test: - image: swift-mmio:22.04-main - - shell: - image: swift-mmio:22.04-main diff --git a/Docker/docker-compose.yaml b/Docker/docker-compose.yaml deleted file mode 100644 index ec4a6728..00000000 --- a/Docker/docker-compose.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# this file is not designed to be run directly -# instead, use the docker-compose.. files -# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.2204.59.yaml run test -version: "3" - -services: - - runtime-setup: - image: swift-mmio:default - build: - context: . - dockerfile: Dockerfile - - common: &common - image: swift-mmio:default - depends_on: [runtime-setup] - volumes: - - ~/.ssh:/root/.ssh - - ..:/code:z - working_dir: /code - - soundness: - <<: *common - command: /bin/bash -xcl "swift -version && uname -a && make lint" - - test: - <<: *common - command: /bin/bash -xcl "make test CONFIGURATION=release" - - shell: - <<: *common - entrypoint: /bin/bash diff --git a/Makefile b/Makefile index 1c168d8d..7dc9f3a8 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,6 @@ SKIP_LINT = .PHONY: all lint format build test clean all: test -ifdef SKIP_LINT -lint: - @echo "skipping linting..." -else lint: @echo "linting..." @swift-format lint \ @@ -27,7 +23,6 @@ lint: --recursive \ --strict \ Package.swift Plugins Sources Tests -endif format: @echo "formatting..." @@ -37,7 +32,7 @@ format: --in-place \ Package.swift Plugins Sources Tests -build: lint +build: @echo "building..." @swift build \ --configuration $(CONFIGURATION) \