Skip to content

Commit

Permalink
migrate circleci workflows to github actions (#9111)
Browse files Browse the repository at this point in the history
Summary:
This pull request converts the CircleCI workflows to GitHub actions workflows.

# Notes

## Checkout v4 does not work
The workflows use the [`flowtype/flow-ci:linux-x86_64`](https://hub.docker.com/r/flowtype/flow-ci/tags) docker image. This images is based on CentOS 7, which unfortunately is missing the version of GLIBC needed to use the [checkout action v4](https://github.com/actions/checkout/releases/tag/v4.1.1). However, [checkout action v3](https://github.com/actions/checkout/releases/tag/v3.6.0) does work.

We could use git to do the checkout. However it's not as simple as running `apt-get install -y git` because the version of git on CentOS is super old. We would need to install git from source on [`flowtype/flow-ci:linux-x86_64`](https://hub.docker.com/r/flowtype/flow-ci/tags) docker image. This is how the [facebook/rocksdb](https://github.com/facebook/rocksdb) folks did it...
evolvedbinary/docker-rocksjava@9cc4bef

## No GitHub hosted linux arm64 runners
The `runtests_linux_arm64` test have been removed because there are no linux arm64 runners. The `github_linux_arm64` deploy job has also been removed. You could potentially run self hosted runners to support this workflow.

The artifact `dist/libflowparser-linux-arm64.zip` is not produced. I have remove the line that copies this artifact from the `npm_pack` job to aviod failure. You could use a self-hosted runner to produce this artifact, or maybe pull it from another source for this job.

## Windows cache breaker
I could not get the windows cache breaker job to work. I reworked the cache key to include the runner.os, runner.arch, and hashfiles of the various files used previously. The only thing missing is the opam version. Since there is only one opam version being used currently, perhaps this is not needed. If in the future you build/test with different opam version, simply use a [matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) and pass in this value and add it to the cache key.

## Secrets
There are placeholders for secrets at the top level of the workflow file. It would be better to provide the secrets to each job or step as needed.

## Not tested
I was unable to test the following jobs:

```
website_deploy
npm_deploy
github_linux
github_macos
github_macos_arm64
github_win
flow_bin_deploy
try_flow_deploy
```

## Testing
[Here is a link to the latest workflow run in my fork](https://github.com/robandpdx-org/flow/actions/runs/7426986082).

### tool_test_win error
<details><summary>Error</summary>

```
Using flow binary: D:\a\flow\flow\bin\win64\flow.exe
Found 30 suites
Tests will be built in C:\Users\RUNNER~1\AppData\Local\Temp\flow\tests\81dddb1582
Running 30 suites
uncaught exception Error: spawn D:\a\flow\flow\bin\win64\flow.exe ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn D:\\a\\flow\\flow\\bin\\win64\\flow.exe',
  path: 'D:\\a\\flow\\flow\\bin\\win64\\flow.exe',
  spawnargs: [
    'server',
    '--strip-root',
    '--debug',
    '--file-watcher',
    'none',
    '--wait-for-recheck',
    'true',
    'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\flow\\tests\\81dddb1582\\autocomplete\\1'
  ]
} Error: spawn D:\a\flow\flow\bin\win64\flow.exe ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
25hCleaning up...
Error: Process completed with exit code 1.
```

</details>

 ---
https://fburl.com/workplace/f6mz6tmw

Pull Request resolved: #9111

Reviewed By: SamChou19815

Differential Revision: D52573243

fbshipit-source-id: 679d1c5109b38cb91b137b3042fb7d69dad7eb15
  • Loading branch information
robandpdx authored and facebook-github-bot committed Mar 12, 2024
1 parent 42d2f00 commit 64a8f3c
Show file tree
Hide file tree
Showing 2 changed files with 685 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/install-opam-mac/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: install-opam-mac
description: Install opam on macOS
inputs:
arch:
description: The architecture of the machine
required: false
runs:
using: composite
steps:
- name: Install opam
run: |-
if ! [ -x "$(command -v opam)" ]; then
echo "Downloading opam..."
curl -sL -o "$RUNNER_TEMP/opam" "https://github.com/ocaml/opam/releases/download/2.0.10/opam-2.0.10-${{ inputs.arch }}-macos"
echo "Installing opam..."
install -m 755 "$RUNNER_TEMP/opam" "/usr/local/bin/opam"
echo "Removing opam temp file..."
rm -f "$RUNNER_TEMP/opam"
fi
shell: bash
Loading

0 comments on commit 64a8f3c

Please sign in to comment.