Skip to content

Commit 326aad0

Browse files
authored
[CI] Support GitHub Actions (#406)
* Update ci_test to support python3 * Add support for GitHub Actions
1 parent 7c6c9bb commit 326aad0

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.github/.DS_Store

6 KB
Binary file not shown.

.github/workflows/pull_request.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build Docker images
2+
on: [pull_request]
3+
4+
env:
5+
ghprbPullId: ${{ github.event.number }}
6+
ghprbGhRepository: ${{ github.repository_owner }}/${{ github.event.repository.name }}
7+
8+
jobs:
9+
build:
10+
name: Build Docker images
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: env && ./ci_test.py

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @shahmishal

ci_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
# ci_test - Build all Dockerfiles -*- python -*-
44
#
55
# This source file is part of the Swift.org open source project
66
#
7-
# Copyright (c) 2019 Apple Inc. and the Swift project authors
7+
# Copyright (c) 2024 Apple Inc. and the Swift project authors
88
# Licensed under Apache License v2.0 with Runtime Library Exception
99
#
1010
# See https://swift.org/LICENSE.txt for license information
@@ -13,7 +13,7 @@
1313

1414
from __future__ import absolute_import, print_function, unicode_literals
1515

16-
import urllib2
16+
import urllib.request
1717
import json
1818
import subprocess
1919
import sys
@@ -36,7 +36,7 @@ def run_command(cmd, log_file=None):
3636
def get_dockerfiles():
3737
dockerfiles = []
3838
GITHUB_API_URL = "https://api.github.com"
39-
response = urllib2.urlopen("{}/repos/{}/pulls/{}/files".format(GITHUB_API_URL,
39+
response = urllib.request.urlopen("{}/repos/{}/pulls/{}/files".format(GITHUB_API_URL,
4040
os.environ['ghprbGhRepository'],
4141
os.environ['ghprbPullId']))
4242
data = json.load(response)

0 commit comments

Comments
 (0)