Skip to content

Commit 8027c69

Browse files
authored
GODRIVER-3182 Replace makefile with taskfile (#1812)
1 parent 3e014cc commit 8027c69

15 files changed

+280
-273
lines changed

.evergreen/config.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ functions:
9595
go version
9696
go env
9797
98+
# Install taskfile.
99+
go install github.com/go-task/task/v3/cmd/task@latest
100+
98101
# Install libmongocrypt.
99-
bash etc/install-libmongocrypt.sh
102+
task install-libmongocrypt
100103
if [ "Windows_NT" = "$OS" ]; then
101104
export PATH=$PATH:/cygdrive/c/libmongocrypt/bin
102105
fi
@@ -278,17 +281,17 @@ functions:
278281
script: |
279282
${PREPARE_SHELL}
280283
export OIDC="oidc"
281-
bash ${PROJECT_DIRECTORY}/etc/run-oidc-test.sh 'make -s evg-test-oidc-auth'
284+
task test-oidc
282285
283-
run-make:
286+
run-task:
284287
- command: shell.exec
285288
type: test
286289
params:
287290
shell: "bash"
288291
working_dir: src/go.mongodb.org/mongo-driver
289292
script: |
290293
${PREPARE_SHELL}
291-
${BUILD_ENV|} BUILD_TAGS=${BUILD_TAGS|-tags=cse,gssapi} make ${targets}
294+
${BUILD_ENV|} BUILD_TAGS=${BUILD_TAGS|-tags=cse,gssapi} task ${targets}
292295
293296
run-tests:
294297
- command: shell.exec
@@ -311,7 +314,7 @@ functions:
311314
${PREPARE_SHELL}
312315
export BASE_SHA=${revision}
313316
export HEAD_SHA=${github_commit}
314-
bash etc/api_report.sh
317+
task api-report
315318
316319
"add PR labels":
317320
- command: shell.exec
@@ -393,7 +396,7 @@ functions:
393396
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
394397
script: |
395398
${PREPARE_SHELL}
396-
bash etc/run-atlas-test.sh
399+
task test-atlas
397400
398401
run-ocsp-test:
399402
- command: shell.exec
@@ -413,7 +416,7 @@ functions:
413416
TOPOLOGY="server" \
414417
MONGODB_URI="${MONGODB_URI}" \
415418
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
416-
make evg-test-ocsp
419+
task evg-test-ocsp
417420
418421
run-versioned-api-test:
419422
- command: shell.exec
@@ -443,7 +446,7 @@ functions:
443446
BUILD_TAGS="-tags=cse" \
444447
REQUIRE_API_VERSION="${REQUIRE_API_VERSION}" \
445448
CRYPT_SHARED_LIB_PATH="$CRYPT_SHARED_LIB_PATH" \
446-
make evg-test-versioned-api \
449+
task evg-test-versioned-api \
447450
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
448451
LD_LIBRARY_PATH=$LD_LIBRARY_PATH
449452
@@ -490,7 +493,7 @@ functions:
490493
MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" \
491494
TOPOLOGY="${TOPOLOGY}" \
492495
MONGO_GO_DRIVER_COMPRESSOR=${MONGO_GO_DRIVER_COMPRESSOR} \
493-
make evg-test-load-balancers
496+
task evg-test-load-balancers
494497
495498
run-serverless-tests:
496499
- command: shell.exec
@@ -514,7 +517,7 @@ functions:
514517
SSL="nossl" \
515518
TOPOLOGY="server" \
516519
MONGODB_URI="mongodb://mhuser:pencil@localhost" \
517-
make evg-test-atlas-data-lake
520+
task evg-test-atlas-data-lake
518521
519522
run-docker-test:
520523
- command: shell.exec
@@ -524,8 +527,8 @@ functions:
524527
working_dir: src/go.mongodb.org/mongo-driver
525528
script: |
526529
${PREPARE_SHELL}
527-
bash etc/run_docker.sh
528-
TOPOLOGY=sharded_cluster bash etc/run_docker.sh test-short
530+
task run-docker
531+
TOPOLOGY=sharded_cluster task run-docker -- test-short
529532
530533
run-valid-ocsp-server:
531534
- command: shell.exec
@@ -610,7 +613,7 @@ functions:
610613
script: |
611614
${PREPARE_SHELL}
612615
TEST_INDEX_URI="${TEST_INDEX_URI}" \
613-
make evg-test-search-index
616+
task evg-test-search-index
614617
615618
add-aws-auth-variables-to-file:
616619
- command: ec2.assume_role
@@ -690,7 +693,7 @@ functions:
690693
echo "This platform does not support the ECS auth test, skipping..."
691694
exit 0
692695
fi
693-
make build-aws-ecs-test
696+
task build-aws-ecs-test
694697
- command: shell.exec
695698
type: test
696699
params:
@@ -775,7 +778,7 @@ functions:
775778
TOPOLOGY="${TOPOLOGY}" \
776779
MONGO_GO_DRIVER_COMPRESSOR=${MONGO_GO_DRIVER_COMPRESSOR} \
777780
BUILD_TAGS="-tags=cse" \
778-
make evg-test-kms \
781+
task evg-test-kms \
779782
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
780783
LD_LIBRARY_PATH=$LD_LIBRARY_PATH
781784
@@ -796,7 +799,7 @@ functions:
796799
TOPOLOGY="${TOPOLOGY}" \
797800
MONGO_GO_DRIVER_COMPRESSOR=${MONGO_GO_DRIVER_COMPRESSOR} \
798801
BUILD_TAGS="-tags=cse" \
799-
make evg-test-kmip \
802+
task evg-test-kmip \
800803
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
801804
LD_LIBRARY_PATH=$LD_LIBRARY_PATH
802805
@@ -822,7 +825,7 @@ tasks:
822825
- name: static-analysis
823826
tags: ["static-analysis"]
824827
commands:
825-
- func: run-make
828+
- func: run-task
826829
vars:
827830
targets: "check-fmt check-license check-modules lint"
828831

@@ -847,7 +850,7 @@ tasks:
847850
TOPOLOGY: "server"
848851
AUTH: "noauth"
849852
SSL: "nossl"
850-
- func: run-make
853+
- func: run-task
851854
vars:
852855
targets: driver-benchmark
853856
- func: send-perf-data
@@ -1593,7 +1596,7 @@ tasks:
15931596
- name: go1.18-build
15941597
tags: ["compile-check"]
15951598
commands:
1596-
- func: run-make
1599+
- func: run-task
15971600
vars:
15981601
targets: "build-compile-check"
15991602
BUILD_ENV: "PATH=/opt/golang/go1.18/bin:$PATH GOROOT=/opt/golang/go1.18"
@@ -1602,7 +1605,7 @@ tasks:
16021605
- name: build
16031606
tags: ["compile-check"]
16041607
commands:
1605-
- func: run-make
1608+
- func: run-task
16061609
vars:
16071610
targets: "build"
16081611

@@ -1726,7 +1729,7 @@ tasks:
17261729
echo "Building build-kms-test ... begin"
17271730
BUILD_TAGS="-tags=cse" \
17281731
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
1729-
make build-kms-test
1732+
task build-kms-test
17301733
echo "Building build-kms-test ... end"
17311734
source $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/secrets-export.sh
17321735
echo "Copying files ... begin"
@@ -1762,7 +1765,7 @@ tasks:
17621765
echo "Building build-kms-test ... begin"
17631766
BUILD_TAGS="-tags=cse" \
17641767
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
1765-
make build-kms-test
1768+
task build-kms-test
17661769
echo "Building build-kms-test ... end"
17671770
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
17681771
MONGODB_URI='mongodb://localhost:27017/' \
@@ -1779,7 +1782,7 @@ tasks:
17791782
working_dir: src/go.mongodb.org/mongo-driver
17801783
script: |
17811784
${PREPARE_SHELL}
1782-
bash etc/run-awskms-test.sh
1785+
task test-awskms
17831786
17841787
- name: "testawskms-fail-task"
17851788
# testawskms-fail-task runs without environment variables.
@@ -1793,7 +1796,7 @@ tasks:
17931796
script: |
17941797
${PREPARE_SHELL}
17951798
export EXPECT_ERROR='status=400'
1796-
bash etc/run-awskms-test.sh
1799+
task test-awskms
17971800
17981801
- name: "testazurekms-task"
17991802
commands:
@@ -1807,7 +1810,7 @@ tasks:
18071810
echo "Building build-kms-test ... begin"
18081811
BUILD_TAGS="-tags=cse" \
18091812
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
1810-
make build-kms-test
1813+
task build-kms-test
18111814
echo "Building build-kms-test ... end"
18121815
18131816
echo "Copying files ... begin"
@@ -1843,7 +1846,7 @@ tasks:
18431846
echo "Building build-kms-test ... begin"
18441847
BUILD_TAGS="-tags=cse" \
18451848
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
1846-
make build-kms-test
1849+
task build-kms-test
18471850
echo "Building build-kms-test ... end"
18481851
18491852
. ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup-secrets.sh

.evergreen/run-tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ else
7676
echo "crypt_shared library will be loaded from path: $CRYPT_SHARED_LIB_PATH"
7777
fi
7878

79-
if [ -z ${MAKEFILE_TARGET+x} ]; then
79+
if [ -z ${TASKFILE_TARGET+x} ]; then
8080
if [ "$(uname -s)" = "Darwin" ]; then
8181
# Run a subset of the tests on Darwin
82-
MAKEFILE_TARGET="evg-test-load-balancers"
82+
TASKFILE_TARGET="evg-test-load-balancers"
8383
else
84-
MAKEFILE_TARGET="evg-test"
84+
TASKFILE_TARGET="evg-test"
8585
fi
8686
fi
8787

@@ -99,4 +99,4 @@ CRYPT_SHARED_LIB_PATH=$CRYPT_SHARED_LIB_PATH \
9999
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
100100
LD_LIBRARY_PATH=$LD_LIBRARY_PATH \
101101
MACOS_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH \
102-
make $MAKEFILE_TARGET
102+
task $TASKFILE_TARGET

.github/workflows/codeql.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ jobs:
3333
languages: go
3434
build-mode: manual
3535

36+
- name: Install Taskfile support
37+
uses: arduino/setup-task@v2
38+
3639
- shell: bash
37-
run: |
38-
make build
40+
run: task build
3941

4042
- name: Perform CodeQL Analysis
4143
uses: github/codeql-action/analyze@v3

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
5050
apt-get -qqy install --option Acquire::Retries=100 --option Acquire::http::Timeout="60" --no-install-recommends golang-go && \
5151
rm -rf /var/lib/apt/lists/*
5252

53+
# Install taskfile
54+
RUN go install github.com/go-task/task/v3/cmd/task@latest
55+
5356
COPY ./etc/docker_entry.sh /root/docker_entry.sh
5457

5558
COPY --from=libmongocrypt /root/install /root/install

0 commit comments

Comments
 (0)