From 703f4e6e676b14eda1abecd951d96de2c1b381f0 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 13:36:56 +0100 Subject: [PATCH 01/11] Add Github Actions CI workflows --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0140ab7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: master + +on: [push] + +env: + timeout: 10 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + - name: Install build requirements + run: | + apt-get update + apt-get install build-essential rpm python3 -y + - name: Build with make + timeout-minutes: ${{ fromJSON(env.time) }} + run: make all + + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + - name: Print environment + run: set + - name: Build with make + timeout-minutes: ${{ fromJSON(env.time) }} + run: make.exe bootstrapper + + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + - name: Print environment + run: env + - name: Build with make + timeout-minutes: ${{ fromJSON(env.time) }} + run: make bootstrapper From 613cb46a8622def8ffcb681a4953b5a0877a15b7 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 13:57:05 +0100 Subject: [PATCH 02/11] CI: Set Go version --- .github/workflows/build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0140ab7..a28f2b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,13 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 + with: + go-version: '1.22.x' + check-latest: true - name: Install build requirements run: | - apt-get update - apt-get install build-essential rpm python3 -y + sudo apt-get update + sudo apt-get install build-essential rpm python3 -y - name: Build with make timeout-minutes: ${{ fromJSON(env.time) }} run: make all @@ -26,6 +29,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 + with: + go-version: '1.22.x' + check-latest: true - name: Print environment run: set - name: Build with make @@ -38,6 +44,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 + with: + go-version: '1.22.x' + check-latest: true - name: Print environment run: env - name: Build with make From d59151d1dad0e365789a294b1a3d936b640fcc21 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:01:05 +0100 Subject: [PATCH 03/11] CI: Set Go version from go.mod --- .github/workflows/build.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a28f2b5..d98c3a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22.x' - check-latest: true + go-version-file: 'go.mod' - name: Install build requirements run: | sudo apt-get update @@ -30,8 +29,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22.x' - check-latest: true + go-version-file: 'go.mod' - name: Print environment run: set - name: Build with make @@ -45,8 +43,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22.x' - check-latest: true + go-version-file: 'go.mod' - name: Print environment run: env - name: Build with make From bb8ea7a0fae88f8f98ed5d4eaa88355e016d4a93 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:02:31 +0100 Subject: [PATCH 04/11] CI: lint build.yml --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d98c3a1..39f8ada 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,8 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' + with: + go-version-file: 'go.mod' - name: Install build requirements run: | sudo apt-get update @@ -28,8 +28,8 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' + with: + go-version-file: 'go.mod' - name: Print environment run: set - name: Build with make @@ -42,8 +42,8 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' + with: + go-version-file: 'go.mod' - name: Print environment run: env - name: Build with make From fd3695347eb5f3fcf3b7b49fa648ec1a1c5ffa24 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:30:52 +0100 Subject: [PATCH 05/11] CI: update jobs --- .github/workflows/build.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39f8ada..2a18384 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,8 @@ jobs: sudo apt-get update sudo apt-get install build-essential rpm python3 -y - name: Build with make - timeout-minutes: ${{ fromJSON(env.time) }} - run: make all + timeout-minutes: ${{ fromJSON(env.timeout) }} + run: make build build-windows: runs-on: windows-latest @@ -31,9 +31,11 @@ jobs: with: go-version-file: 'go.mod' - name: Print environment - run: set + run: cmd.exe /K set + - name: Print environment + run: gci env:* | sort-object name - name: Build with make - timeout-minutes: ${{ fromJSON(env.time) }} + timeout-minutes: ${{ fromJSON(env.timeout) }} run: make.exe bootstrapper build-macos: @@ -47,5 +49,5 @@ jobs: - name: Print environment run: env - name: Build with make - timeout-minutes: ${{ fromJSON(env.time) }} + timeout-minutes: ${{ fromJSON(env.timeout) }} run: make bootstrapper From 2af456bf54b229b5ce5fd288896d9cbd21907ee3 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:35:10 +0100 Subject: [PATCH 06/11] Makefile: macOS uname only supports short flags --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fc4fb16..1ae4f3d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ bootstrapper: @if [ -n "$${OS}" ] ; then \ UNAME_OS="$${OS}"; \ else \ - UNAME_OS=$$(uname --kernel-name); \ + UNAME_OS=$$(uname -s); \ fi; \ if [ "$${UNAME_OS}" = "Linux" ] ; then \ make -s build; \ From 065ef978bd9149cabed0d6b8209fc2af35111bd9 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:38:52 +0100 Subject: [PATCH 07/11] CI: check output --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a18384..735a893 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,8 @@ jobs: - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make build + - name: Check output + run: ls -a ./scion-bootstrapper ./bin/ build-windows: runs-on: windows-latest @@ -37,6 +39,8 @@ jobs: - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make.exe bootstrapper + - name: Check output + run: dir scion-bootstrapper.exe build-macos: runs-on: macos-latest @@ -51,3 +55,5 @@ jobs: - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make bootstrapper + - name: Check output + run: ls -a ./scion-bootstrapper ./bin/ From 97201ed28586b9f6e2ae605d3edd4befd669be13 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:42:25 +0100 Subject: [PATCH 08/11] CI: check help flag --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 735a893..ea043a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,8 @@ jobs: run: make build - name: Check output run: ls -a ./scion-bootstrapper ./bin/ + - name: Check help + run: ./scion-bootstrapper --help build-windows: runs-on: windows-latest @@ -41,6 +43,8 @@ jobs: run: make.exe bootstrapper - name: Check output run: dir scion-bootstrapper.exe + - name: Check help + run: scion-bootstrapper.exe --help build-macos: runs-on: macos-latest @@ -57,3 +61,5 @@ jobs: run: make bootstrapper - name: Check output run: ls -a ./scion-bootstrapper ./bin/ + - name: Check help + run: ./scion-bootstrapper --help From 9739fd06bcf2cacffaebdc5133536e2e6d1b8bd2 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 14:52:26 +0100 Subject: [PATCH 09/11] CI: make all --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea043a9..e4d994d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,17 @@ jobs: - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make build - - name: Check output - run: ls -a ./scion-bootstrapper ./bin/ - name: Check help run: ./scion-bootstrapper --help + - name: Install test requirements + run: | + wget https://github.com/scionproto/scion/releases/download/v0.12.0/scion_0.12.0_amd64_linux.tar.gz -O /tmp/scion_0.12.0_amd64_linux.tar.gz + tar -xf /tmp/scion_0.12.0_amd64_linux.tar.gz scion-pki + - name: Make all + timeout-minutes: ${{ fromJSON(env.timeout) }} + run: make all + - name: Check output + run: ls -a ./scion-bootstrapper ./bin/ build-windows: runs-on: windows-latest From 9c859034e40ac4dd4a1d79e4e57411019e047fcc Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 15:00:15 +0100 Subject: [PATCH 10/11] CI: update paths --- .github/workflows/build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4d994d..5f890a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' + - name: Print environment + run: env - name: Install build requirements run: | sudo apt-get update @@ -26,7 +28,7 @@ jobs: - name: Install test requirements run: | wget https://github.com/scionproto/scion/releases/download/v0.12.0/scion_0.12.0_amd64_linux.tar.gz -O /tmp/scion_0.12.0_amd64_linux.tar.gz - tar -xf /tmp/scion_0.12.0_amd64_linux.tar.gz scion-pki + tar -C /usr/local/bin -xf /tmp/scion_0.12.0_amd64_linux.tar.gz scion-pki - name: Make all timeout-minutes: ${{ fromJSON(env.timeout) }} run: make all @@ -41,17 +43,17 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - name: Print environment - run: cmd.exe /K set - - name: Print environment - run: gci env:* | sort-object name + #- name: Print environment + # run: cmd.exe /K set + #- name: Print environment + # run: gci env:* | sort-object name - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make.exe bootstrapper - name: Check output run: dir scion-bootstrapper.exe - name: Check help - run: scion-bootstrapper.exe --help + run: ./scion-bootstrapper.exe --help build-macos: runs-on: macos-latest @@ -61,8 +63,8 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - name: Print environment - run: env + #- name: Print environment + # run: env - name: Build with make timeout-minutes: ${{ fromJSON(env.timeout) }} run: make bootstrapper From 7e920faf609ad60985439155463397088122cdf8 Mon Sep 17 00:00:00 2001 From: FR4NK-W Date: Thu, 28 Nov 2024 15:09:06 +0100 Subject: [PATCH 11/11] CI: cleanup --- .github/workflows/build.yml | 2 -- hinting/dns_search_domain_fallbacks_test.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f890a5..5ac50d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,6 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - name: Print environment - run: env - name: Install build requirements run: | sudo apt-get update diff --git a/hinting/dns_search_domain_fallbacks_test.go b/hinting/dns_search_domain_fallbacks_test.go index 8c53c5b..1b31cc6 100644 --- a/hinting/dns_search_domain_fallbacks_test.go +++ b/hinting/dns_search_domain_fallbacks_test.go @@ -80,7 +80,7 @@ func TestReverseLookupDomains(t *testing.T) { domain string }{ {ip: netip.MustParseAddr("163.152.6.10"), domain: "korea.ac.kr"}, - {ip: randIPFromCIDR("163.152.6.16/29"), domain: "korea.ac.kr"}, + {ip: randIPFromCIDR("163.152.6.24/29"), domain: "korea.ac.kr"}, }, }, }