Skip to content

Commit 305aaaa

Browse files
committed
Move github-actions-deps out of Makefile
1 parent f58e9e7 commit 305aaaa

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
needs-python: ${{ true }}
2626
needs-node: ${{ false }}
2727
- name: Dependencies
28-
command: bin/deps
28+
command: bin/github-actions-deps
2929
needs-python: ${{ true }}
3030
needs-node: ${{ false }}
3131
- name: Licenses

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ requirements/%.txt: requirements/%.in
8484
PATH="/opt/warehouse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
8585
bin/pip-compile --allow-unsafe --generate-hashes --output-file=$@ $<
8686

87-
github-actions-deps:
88-
ifneq ($(GITHUB_BASE_REF), false)
89-
git fetch origin $(GITHUB_BASE_REF):refs/remotes/origin/$(GITHUB_BASE_REF)
90-
# Check that the following diff will exit with 0 or 1
91-
git diff --name-only FETCH_HEAD || test $? -le 1 || exit 1
92-
# Make the dependencies if any changed files are requirements files, otherwise exit
93-
git diff --name-only FETCH_HEAD | grep '^requirements/' || exit 0 && bin/deps
94-
endif
95-
9687
initdb:
9788
docker-compose run --rm web psql -h db -d postgres -U postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname ='warehouse';"
9889
docker-compose run --rm web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS warehouse"

bin/github-actions-deps

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Click requires us to ensure we have a well configured environment to run
5+
# our click commands. So we'll set our environment to ensure our locale is
6+
# correct.
7+
export LC_ALL="${ENCODING:-en_US.UTF-8}"
8+
export LANG="${ENCODING:-en_US.UTF-8}"
9+
10+
# Print all the followng commands
11+
set -x
12+
13+
if [[ -z "${GITHUB_BASE_REF}" ]]; then
14+
git fetch origin $(GITHUB_BASE_REF):refs/remotes/origin/$(GITHUB_BASE_REF)
15+
# Check that the following diff will exit with 0 or 1
16+
git diff --name-only FETCH_HEAD || test $? -le 1 || exit 1
17+
# Make the dependencies if any changed files are requirements files, otherwise exit
18+
git diff --name-only FETCH_HEAD | grep '^requirements/' || exit 0 && bin/deps
19+
fi

0 commit comments

Comments
 (0)