forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 9
102 lines (96 loc) · 3.28 KB
/
docker-build.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Docker Build
on: [push]
jobs:
docker-build-image:
runs-on: ubuntu-latest
env:
docker_tag: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
steps:
- uses: actions/checkout@v4
#- name: Dump context
# uses: crazy-max/ghaction-dump-context@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull just in case
run: docker pull ghcr.io/${{ github.repository }}/linux || true
- name: Build containers using docker-compose
run: docker-compose build
- name: Re-tag
run: docker tag ghcr.io/${{ github.repository }}/linux:latest ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}
- name: Work
run: docker push ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}
outputs:
docker_tag: ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}
build:
needs: [docker-build-image]
runs-on: [self-hosted, chrobalt-linux-runner]
container: ${{ needs.docker-build-image.outputs.docker_tag }}
env:
DEPOT_TOOLS_UPDATE: 0
DEPOT_TOOLS_REPORT_BUILD: 0
DEPOT_TOOLS_COLLECT_METRICS: 0
DEPOT_TOOLS_METRICS: 0
SCCACHE: 1
SCCACHE_GCS_BUCKET: cobalt-actions-sccache-linux
SCCACHE_GCS_OAUTH_URL: http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
SCCACHE_GCS_RW_MODE: READ_WRITE
SCCACHE_IDLE_TIMEOUT: 0 # prevent sccache server from shutting down after long idle.
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
# - name: Dump context
# uses: crazy-max/ghaction-dump-context@v2
- name: Get depot tools
run: git clone -b dev https://github.com/kaidokert/depot_tools.git
- name: Add directory to PATH
run: echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
- name: Generate gclient file
run: |
whoami
gclient config --help
gclient sync --help
gclient config --name=src https://github.com/${{ github.repository }}
- name: Gclient sync
run: gclient sync -v --shallow --no-history -r ${{ github.sha }}
- name: DF
run: df -h
- name: Du
run: du -ht 500M
- name: sccache check
run: sccache -s
- name: gn gen
run: |
cd src
gn gen out/Default --args='cc_wrapper="sccache"'
- name: ninja base_unittests
run: |
cd src
ninja -C out/Default base_unittests
- name: ninja sql_unittests
run: |
cd src
ninja -C out/Default sql_unittests
- name: ninja net_unittests
run: |
cd src
ninja -C out/Default net_unittests
- name: ninja url_unittests
run: |
cd src
ninja -C out/Default url_unittests
- name: ninja ipc_tests
run: |
cd src
ninja -C out/Default ipc_tests
- name: sccache check
run: sccache -s
- name: Any speed
run: echo Any speed