Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement (very basic) first version #5

Merged
merged 9 commits into from
Jun 20, 2024

Conversation

paulo-ferraz-oliveira
Copy link
Collaborator

@paulo-ferraz-oliveira paulo-ferraz-oliveira commented Jun 19, 2024

Description

This pull request is a step in the next direction 😄

  1. renames input-1 as elp-version and drops outputs
  2. tests with the help of erlef/setup-beam: both npm test and the action itself
  3. implements basic understanding of archictectures and platforms
  4. installs ELP and caches it as a tool
  5. outputs the result of elp version when installed
  6. fetches Erlang version from running system (using -eval)

1. renames input-1 as elp-version and drops outputs
2. tests with the help of erlef/setup-beam: both test and action
3. implements basic understanding of arch.s and platforms
4. installs ELP and caches it as a tool
5. outputs the result of `elp version` when installed
6. fetches Erlang version from running system (using -eval)

- name: Output input-1 (from output-1)
run: echo "${{ steps.setup-elp.outputs.output-1 }}"
- run: elp version
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this works, it means installation for ELP for the arch + platform + OTP (derived from the erl execution) went Ok

README.md Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be complete, at the moment; it's just a better draft than what we had.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not close to complete, but a very basic working version (locally everything passes until I reach elp version - I believe it's because I'm downloading for ARM, but the executable is AMD)

src/setup-elp.js Outdated

const runnerToolPath = path.join(process.env.RUNNER_TEMP, '.setup-elp', 'elp')
fs.cpSync(cachePath, runnerToolPath, { recursive: true })
fs.chmodSync(path.join(runnerToolPath, 'elp'), 0o755)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is required. Doing a regular download (wget + tar zx) fetches the proper attributes.

@paulo-ferraz-oliveira paulo-ferraz-oliveira force-pushed the feature/very-basic-first-version branch from b1d5190 to f60191b Compare June 19, 2024 23:39
... so we turn YYYY-MM-DD_N into YYYY.MM.DD+N
@paulo-ferraz-oliveira paulo-ferraz-oliveira force-pushed the feature/very-basic-first-version branch from 7b2b416 to 8a11f0a Compare June 20, 2024 00:16
Comment on lines +43 to +46
function semverFromELPVersion(elpVersion) {
let [major, minor, patch, build] = elpVersion.split(/[-_]/).slice(0, 4)
return `${Number(major)}.${Number(minor)}.${Number(patch)}+${Number(build) || 1}`
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An important element...

@paulo-ferraz-oliveira paulo-ferraz-oliveira merged commit e2ddc18 into main Jun 20, 2024
2 checks passed
@paulo-ferraz-oliveira paulo-ferraz-oliveira deleted the feature/very-basic-first-version branch June 20, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant