-
Notifications
You must be signed in to change notification settings - Fork 12
70 lines (67 loc) · 2.54 KB
/
integration_test.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: integration_test
on:
push:
pull_request_target:
schedule:
- cron: '30 5 * * *'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
EARTHLY_SECRETS: ${{ secrets.EARTHLY_SECRETS }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v3
- 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
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
- name: download latest earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.15/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: export secrets
if: ${{ !(github.event_name == 'push' && github.ref_name == 'master') }}
run: |
export GW2_API_KEY=""
export GW2_TESTING_CHAR=""
- name: build and run test
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: earthly --ci --push --remote-cache=greaka/gw2lib:cache -P +test
- name: build and run test
if: ${{ !(github.event_name == 'push' && github.ref_name == 'master') }}
run: earthly --ci --remote-cache=greaka/gw2lib:cache -P +test
test-ignored:
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
EARTHLY_SECRETS: ${{ secrets.EARTHLY_SECRETS }}
steps:
- uses: actions/checkout@v3
- 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: download latest earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.15/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: export secrets
if: ${{ !(github.event_name == 'push' && github.ref_name == 'master') }}
run: |
export GW2_API_KEY=""
export GW2_TESTING_CHAR=""
- name: build and run test
run: earthly --ci --remote-cache=greaka/gw2lib:cache -P +test-ignored