-
-
Notifications
You must be signed in to change notification settings - Fork 814
103 lines (84 loc) · 3.3 KB
/
test_extension_dockerfile.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
103
name: Test extension builder Dockerfile
on:
#Run weekly every Thursday (one day before AMO submission)
schedule:
- cron: "0 2 * * 5"
#Allow for manual tests if needed
workflow_dispatch:
jobs:
test-dockerfile:
name: Test the Dockerfile
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: https://registry.npmjs.org
- name: Install wasm-bindgen
run: cargo install wasm-bindgen-cli --version 0.2.95
# Keep the version number in sync in all workflows,
# and in the extension builder Dockerfile!
- name: Install wasm-opt
uses: sigoden/install-binary@v1
with:
repo: WebAssembly/binaryen
tag: version_120
name: wasm-opt
- name: Install fclones
run: cargo install fclones
- name: Install node packages
working-directory: web
shell: bash -l {0}
run: npm ci
- name: Seal version data
shell: bash -l {0}
working-directory: web
env:
ENABLE_VERSION_SEAL: "true"
run: npm run version-seal
- name: Build web normally
working-directory: web
shell: bash -l {0}
env:
CARGO_FEATURES: jpegxr
WASM_SOURCE: cargo_and_store
run: npm run build:repro
- name: Build Docker image with Ruffle in it
run: docker build --tag ruffle-web-docker -f web/docker/Dockerfile .
- name: Copy extensions out of Docker image
run: docker cp $(docker create ruffle-web-docker:latest):/ruffle/web/packages web/docker/docker_builds/packages
- name: Check that the Firefox extension was built
run: test -f web/docker/docker_builds/packages/extension/dist/firefox_unsigned.xpi
- name: Compare the two extensions
run: |
mkdir firefox_extensions
mkdir firefox_extensions/docker_build
mkdir firefox_extensions/normal_build
unzip -d firefox_extensions/normal_build "./web/packages/extension/dist/firefox_unsigned.xpi"
unzip -d firefox_extensions/docker_build "./web/docker/docker_builds/packages/extension/dist/firefox_unsigned.xpi"
fclones group --unique firefox_extensions/normal_build firefox_extensions/docker_build -o result.txt -f fdupes
fclones group --unique firefox_extensions/normal_build firefox_extensions/docker_build -o firefox_extensions/differences.txt
cat result.txt
- name: Check that the comparison was identical
run: test ! -s result.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: result
path: firefox_extensions/
- name: Notify Discord
uses: th0th/[email protected]
if: ${{ always() && github.repository == 'ruffle-rs/ruffle' }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_UPDATES }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_JOB_NAME: "Build extension via Dockerfile"
GITHUB_JOB_STATUS: ${{ job.status }}