forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.16 KB
/
earthly-contrib.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Runs Earthly targets
name: Earthly Contrib
on:
workflow_call:
jobs:
run-tests:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.7.21
- uses: actions/checkout@v4
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
branch=""
if [ -n "$GITHUB_HEAD_REF" ]; then
branch="$GITHUB_HEAD_REF"
else
branch="${GITHUB_REF##*/}"
fi
git checkout -b "$branch" || true
- name: Docker Login
run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
- name: Earthly version
run: earthly --version
- name: Run test
run: earthly --ci --secret ELECTRICITYMAP_PUBLIC_TOKEN="$ELECTRICITYMAP_PUBLIC_TOKEN" --secret SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" +test-all
env:
ELECTRICITYMAP_PUBLIC_TOKEN: 'test'
SENTRY_AUTH_TOKEN: ''