Skip to content

Commit

Permalink
Fix the "default arch" code path with Julia nightly (and add a CI job…
Browse files Browse the repository at this point in the history
… for that code path)
  • Loading branch information
DilumAluthge committed Jun 25, 2022
1 parent 40f50bc commit e439d3b
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
backup:
runs-on: ubuntu-20.04
timeout-minutes: 60

steps:
- name: Configure cache
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: "PR Checks"
on: [pull_request, push]

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
check_pr:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v1

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#
name: "CodeQL"

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

on:
push:
branches: [ master, releases/* ]
Expand All @@ -24,6 +30,7 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 60

strategy:
fail-fast: false
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/example-builds-defaultarch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Example builds (default arch)

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

on:
push:
branches: ['main', 'master', 'releases/*']
Expand All @@ -9,6 +15,7 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/example-builds-nightly-defaultarch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Example builds (nightly, default arch)

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

on:
push:
branches: ['main', 'master', 'releases/*']
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version: [nightly, 1.8-nightly]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v1.0.0

- name: "Install dependencies"
run: |
npm install --legacy-peer-deps
npm run build
npm run pack
- name: "Set up Julia (${{ matrix.julia-version }})"
uses: ./
with:
version: ${{ matrix.julia-version }}
- run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
11 changes: 9 additions & 2 deletions .github/workflows/example-builds-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Example builds (nightly)

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

on:
push:
branches: ['main', 'master', 'releases/*']
Expand All @@ -10,6 +16,7 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -20,10 +27,10 @@ jobs:
exclude:
- os: macOS-latest
julia-arch: x86

steps:
- uses: actions/checkout@v1.0.0

- name: "Install dependencies"
run: |
npm install --legacy-peer-deps
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/example-builds.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Example builds

concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

on:
push:
branches: ['main', 'master', 'releases/*']
Expand All @@ -9,6 +15,7 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -19,7 +26,7 @@ jobs:
exclude:
- os: macOS-latest
julia-arch: x86

steps:
- uses: actions/checkout@v1.0.0

Expand Down
5 changes: 1 addition & 4 deletions lib/installer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions lib/setup-julia.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ const osMap = {
}
const archMap = {
'x86': 'i686',
'X86': 'i686',
'x64': 'x86_64',
'X64': 'x86_64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
'aarch64': 'aarch64'
}

// Store information about the environment
Expand Down
15 changes: 13 additions & 2 deletions src/setup-julia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ import * as path from 'path'

import * as installer from './installer'

const archSynonyms = {
'x86': 'x86',
'X86': 'x86',
'x64': 'x64',
'X64': 'x64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
}

async function run() {
try {
// Debugging info
Expand All @@ -30,7 +39,7 @@ async function run() {

// Inputs
const versionInput = core.getInput('version')
const arch = core.getInput('arch')
const originalArchInput = core.getInput('arch')

// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
// while the strategy matrix only contains a key `${{ matrix.version }}`.
Expand All @@ -40,10 +49,12 @@ async function run() {
if (!versionInput) {
throw new Error('Version input must not be null')
}
if (!arch) {
if (!originalArchInput) {
throw new Error(`Arch input must not be null`)
}

const arch = archSynonyms[originalArchInput]

const versionInfo = await installer.getJuliaVersionInfo()
const availableReleases = await installer.getJuliaVersions(versionInfo)
const version = installer.getJuliaVersion(availableReleases, versionInput)
Expand Down

0 comments on commit e439d3b

Please sign in to comment.